From fead8b8c8f3a1973d32e15b81529405ea0c53ec1 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Wed, 18 Jun 2025 14:28:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=96=87=E4=BB=B6=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request-download.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/request-download.js b/src/utils/request-download.js index 03ab1808..c5e14a7f 100644 --- a/src/utils/request-download.js +++ b/src/utils/request-download.js @@ -50,7 +50,8 @@ service.interceptors.response.use( const a = document.createElement('a') // xls类型: application/vnd.ms-excel // xlsx类型:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8 - const href = URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' })) + // const href = URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' })) + const href = URL.createObjectURL(new Blob([res], { type: response.headers['content-type'] })) a.download = fileName a.href = href a.click()