From 93395df7facd17601e16caadab574a5838b676fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E4=B8=80=E4=BA=8C?= <13432380277@163.com> Date: Wed, 19 Jun 2024 00:25:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(src/api/base/index.ts):=20=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=97=A0=E6=B3=95=E4=B8=8A=E4=BC=A0=E5=9B=BE?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 富文本调用上传接口时,content-type 为 application/json导致无法上传图片,修改上传接口,指定 content-type 为 multipart/form-data解决问题 Closes #109 --- web/src/api/base/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/web/src/api/base/index.ts b/web/src/api/base/index.ts index 59217d5..c1f2982 100644 --- a/web/src/api/base/index.ts +++ b/web/src/api/base/index.ts @@ -16,6 +16,7 @@ export function UploadImage(params) { const headers = { Authorization: useUserStore.token, uploadType: 'default', + 'Content-Type': 'multipart/form-data', }; return http.request({ url: '/upload/file',