diff --git a/src/utils/zipdownload.js b/src/utils/zipdownload.js index 286b62a6..d5211b58 100644 --- a/src/utils/zipdownload.js +++ b/src/utils/zipdownload.js @@ -1,5 +1,7 @@ import axios from 'axios' import {getCookieForName} from "@/api/method"; +import ElementUI from 'element-ui'; +import 'element-plus/dist/index.css' const mimeMap = { @@ -40,8 +42,7 @@ export function downLoadZipManage(str, filename,fun) { console.log("downLoadZipManage res res.headers.ecode ==> ",res.headers.ecode) if(res.headers.ecode == 4){ //TODO1-1 弹出框 - this.$message.error("权限不足!"); - if(fun) fun() + if(fun) fun(res.headers.ecode) return; } resolveBlob(res, mimeMap.xlsx,filename) diff --git a/src/views/report/TrainingNewManager.vue b/src/views/report/TrainingNewManager.vue index 7aa79012..ff53f2d1 100644 --- a/src/views/report/TrainingNewManager.vue +++ b/src/views/report/TrainingNewManager.vue @@ -18,8 +18,13 @@ import {downLoadZipManage} from "@/utils/zipdownload"; const downReport = () => { spinning.value = true if(uploadAdmin('training-admin')){ - downLoadZipManage(`/admin/project/report/data`,'新任管理者培训数据',function(){ - spinning.value = false + downLoadZipManage(`/admin/project/report/data`,'新任管理者培训数据',function(code){ + + if(code == 4){ + spinning.value = false; + this.$message.error("权限不足!"); + } + }) return }