fix: 上传 FormData 交由 axios 自动设置 multipart 边界

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nixevol
2026-06-28 17:11:02 +08:00
co-authored by Cursor
parent a58c71495d
commit 841905c47e
2 changed files with 2 additions and 4 deletions
+1 -3
View File
@@ -60,9 +60,7 @@ async function doUpload({ file, onFinish, onError }: UploadCustomRequestOptions)
try {
const fd = new FormData();
fd.append('file', file.file as File);
const res: any = await post(`/upload?type=${props.type}`, fd, {
headers: { 'Content-Type': 'multipart/form-data' },
});
const res: any = await post(`/upload?type=${props.type}`, fd);
emit('update:modelValue', [
...(props.modelValue || []),
{ key: res.key, url: res.url, name: res.name, type: props.type },