fix: 修复本地图片上传与发布进程切换

This commit is contained in:
que01 committed 2026-10-13 16:00:42 +08:00
1 parent 7f67f4d685
commit dcf1d76944
7 files changed
+121 -25

No files matched your search

+6 -1
View File
@@ -52,7 +52,12 @@ export function ImageUrlField({ id, value, onChange, placeholder, scope }: Image
});
const response = await fetch(presign.uploadUrl, {
method: "PUT",
headers: { "content-type": file.type },
headers: {
"content-type": file.type,
...(presign.uploadUrl.startsWith("/api/")
? { authorization: `Bearer ${localStorage.getItem("adminToken") ?? ""}` }
: {}),
},
body: file,
});
if (!response.ok) throw new Error(`upload failed: ${response.status}`);