Fix(#796)\ 改进了 NoteGen 的 S3 图床功能兼容性支持阿里云oss连接 #798
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
概要
本 PR 改进了 NoteGen 的 S3 图床功能支持阿里云oss连接
并修复了导致构建失败的日文多语言(
messages/ja.json)问题。背景 / 动机
messages/ja.json文件中包含无效 JSON,导致构建过程直接失败。这个 PR 针对以上问题进行了修复,使本地开发更顺畅,
并让 S3 图床配置和排错更加可靠。
具体改动
endpoint、bucket和pathPrefix,避免生成异常 URL,解决类似
/images//xxx.png的重复斜杠问题。(如
https://wjnote.oss-cn-beijing.aliyuncs.com/...)生成正确。将 payload 参数从仅接受
ArrayBuffer改为接受BufferSource,满足编译器类型检查。
messages/ja.json)修复messages/ja.json为合法 JSON,构建时可以正常解析。en.json的结构一致。工作原理(简要说明)
以确定性的方式生成最终 URL。
而不是返回空白或不明确的错误。
测试情况
本地已进行如下测试(请根据你实际执行的情况勾选/修改):
pnpm tauri dev启动 Tauri 应用,确认应用正常启动。pnpm build),确认messages/ja.json不再触发 JSON 解析错误。
兼容性 / 潜在影响
但由于现在对 endpoint / path 的处理更规范,
可能会暴露之前被忽略的配置问题(例如多余斜杠)。
其他说明
在真实的 Tauri 运行环境中不会生效,也不会干扰现有逻辑。