|
|
@@ -72,7 +72,7 @@ service.interceptors.response.use(res => {
|
|
72
|
72
|
// 获取错误信息
|
|
73
|
73
|
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
|
74
|
74
|
// 二进制数据则直接返回
|
|
75
|
|
- if(res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer'){
|
|
|
75
|
+ if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
|
|
76
|
76
|
return res.data
|
|
77
|
77
|
}
|
|
78
|
78
|
if (code === 401) {
|
|
|
@@ -125,8 +125,8 @@ export function download(url, params, filename, config) {
|
|
125
|
125
|
responseType: 'blob',
|
|
126
|
126
|
...config
|
|
127
|
127
|
}).then(async (data) => {
|
|
128
|
|
- const isLogin = await blobValidate(data);
|
|
129
|
|
- if (isLogin) {
|
|
|
128
|
+ const isBlob = blobValidate(data);
|
|
|
129
|
+ if (isBlob) {
|
|
130
|
130
|
const blob = new Blob([data])
|
|
131
|
131
|
saveAs(blob, filename)
|
|
132
|
132
|
} else {
|