fix 修复 前端download方法响应json异常问题
This commit is contained in:
parent
7321b4c4ca
commit
30e1ea1c6d
@ -191,7 +191,8 @@ export function download(url: string, params: any, fileName: string) {
|
||||
const blob = new Blob([resp]);
|
||||
FileSaver.saveAs(blob, fileName);
|
||||
} else {
|
||||
const resText = await resp.data.text();
|
||||
const blob = new Blob([resp]);
|
||||
const resText = await blob.text();
|
||||
const rspObj = JSON.parse(resText);
|
||||
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'];
|
||||
ElMessage.error(errMsg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user