fix:导出加载条显示异常,下载参数

This commit is contained in:
秋帆
2024-04-10 23:05:09 +08:00
parent 7885e351a0
commit 5869c34abb
6 changed files with 11 additions and 8 deletions

View File

@@ -11,14 +11,13 @@ interface NavigatorWithMsSaveOrOpenBlob extends Navigator {
msSaveOrOpenBlob(blob: Blob, fileName: string): void
}
export const useDownload = async (
api: (param: any) => Promise<any>,
tempName: string = '',
params: any = {},
api: () => Promise<any>,
isNotify = true,
tempName: string = '',
fileType = '.xlsx'
) => {
try {
const res = await api(params)
const res = await api()
if (res.headers['content-disposition']) {
tempName = decodeURI(res.headers['content-disposition'].split(';')[1].split('=')[1]);
} else {