优化文件下载

This commit is contained in:
sk1551 2021-01-29 13:46:31 +08:00
parent 399fd8f1b4
commit f7db1bcb1b
2 changed files with 47 additions and 47 deletions

View File

@ -18,7 +18,7 @@ export function downLoadZip(str, filename) {
resolveBlob(res, mimeMap.zip)
})
}
export function downLoadUrl(str) {
export function downLoadUrl(str, item) {
var url = baseUrl + str
axios({
method: 'get',
@ -26,8 +26,8 @@ export function downLoadUrl(str) {
responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getToken() },
}).then(res => {
console.log(res);
// downloadFileFun(res, item)
// console.log(res);
downloadFileFun(res.data, item)
})
}

View File

@ -67,7 +67,7 @@ export default {
},
load() {},
down(row) {
downLoadUrl(row.fileurl);
downLoadUrl(row.fileurl,row);
},
},
};