From b6557de0ca70298059d2e6300df33db8357c8f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E8=BE=89?= Date: Thu, 21 Nov 2024 16:29:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/utils/service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/web/src/utils/service.ts b/web/src/utils/service.ts index afb30cc..4207572 100644 --- a/web/src/utils/service.ts +++ b/web/src/utils/service.ts @@ -215,6 +215,7 @@ export const downloadFile = function ({ url, params, method, filename = '文件 // headers: {Accept: 'application/vnd.openxmlformats-officedocument'} }).then((res: any) => { // console.log(res.headers['content-type']); // 根据content-type不同来判断是否异步下载 + // if (res.headers && res.headers['Content-type'] === 'application/json') return successMessage('导入任务已创建,请前往‘下载中心’等待下载'); if (res.headers['content-type'] === 'application/json') return successMessage('导入任务已创建,请前往‘下载中心’等待下载'); const xlsxName = window.decodeURI(res.headers['content-disposition'].split('=')[1]) const fileName = xlsxName || `${filename}.xlsx`