This commit is contained in:
Teo
2025-08-22 19:53:14 +08:00
parent 9dfa9ee146
commit 9584ab4baa
7 changed files with 408 additions and 11 deletions

View File

@ -176,7 +176,7 @@ service.interceptors.response.use(
}
);
// 通用下载方法
export function download(url: string, params: any, fileName: string) {
export function download(url: string, params: any, fileName: string, isHeader) {
downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' });
// prettier-ignore
return service.post(url, params, {
@ -186,7 +186,7 @@ export function download(url: string, params: any, fileName: string) {
return tansParams(params);
}
],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
headers: isHeader?{}:{ 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob'
}).then(async (resp: any) => {
const isLogin = blobValidate(resp);