From 841905c47ecce6456f2e71e9d379b25f68a72389 Mon Sep 17 00:00:00 2001 From: Nixevol Date: Sun, 28 Jun 2026 17:11:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8A=E4=BC=A0=20FormData=20?= =?UTF-8?q?=E4=BA=A4=E7=94=B1=20axios=20=E8=87=AA=E5=8A=A8=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=20multipart=20=E8=BE=B9=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- apps/admin/src/components/MediaUpload.vue | 4 +--- apps/admin/src/views/Outbound.vue | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/admin/src/components/MediaUpload.vue b/apps/admin/src/components/MediaUpload.vue index ca863e2..003f1f3 100644 --- a/apps/admin/src/components/MediaUpload.vue +++ b/apps/admin/src/components/MediaUpload.vue @@ -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 }, diff --git a/apps/admin/src/views/Outbound.vue b/apps/admin/src/views/Outbound.vue index 83290bc..6db6449 100644 --- a/apps/admin/src/views/Outbound.vue +++ b/apps/admin/src/views/Outbound.vue @@ -66,7 +66,7 @@ async function doImport({ file, onFinish, onError }: UploadCustomRequestOptions) try { const fd = new FormData(); fd.append('file', file.file as File); - const res: any = await post('/outbound/import', fd, { headers: { 'Content-Type': 'multipart/form-data' } }); + const res: any = await post('/outbound/import', fd); const jobId = res.jobId; let job: any = null; for (let i = 0; i < 40; i++) {