fix: 报告下载 token过期下载文件错误

This commit is contained in:
@changcode
2022-05-10 18:20:44 +08:00
parent da0eb999e7
commit d8e79b97f7

View File

@@ -188,6 +188,8 @@ export default {
} else if (!localStorage.getItem(storageKey.token) && n === 1) {
return window.location.replace('/')
}
get(api.reportTemp).then(res => {
if (res.code === 200) {
axios.get(url, { responseType: 'blob', params: params }).then(res => {
if (window.navigator.msSaveOrOpenBlob) {
// 兼容ie11
@@ -233,6 +235,8 @@ export default {
this.$refs.dataTable.loadingTableId = !u.id
}
})
}
})
},
preview (u) {
if (this.$refs.dataTable.loadingPreviewId === u.id) { // 列表单个下载