From fd747e03d58f0d0e7f2296b0c7bfe02de1c5e2bf Mon Sep 17 00:00:00 2001 From: gengxin Date: Mon, 10 Mar 2025 18:43:54 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=EF=BC=8C=E7=BC=96=E8=BE=91=E5=9B=9E=E6=98=BE7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/zipdownload.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/zipdownload.js b/src/utils/zipdownload.js index 5196632c..c44775ee 100644 --- a/src/utils/zipdownload.js +++ b/src/utils/zipdownload.js @@ -36,6 +36,7 @@ export function downLoadZipManage(str, filename,fun) { responseType: 'blob', headers: { 'Authorization': 'Bearer ' + getCookieForName("token") } }).then(res => { + console.log("downLoadZipManage res nginx ==> ",res) resolveBlob(res, mimeMap.xlsx,filename) if(fun) fun() }) From 9c1761db099bdfabc4e3f9d31d9fb352b288d59e Mon Sep 17 00:00:00 2001 From: gengxin Date: Mon, 10 Mar 2025 19:24:22 +0800 Subject: [PATCH 2/6] =?UTF-8?q?1.=20=E4=BF=A1=E4=BB=BB=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/zipdownload.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/zipdownload.js b/src/utils/zipdownload.js index c44775ee..83accd64 100644 --- a/src/utils/zipdownload.js +++ b/src/utils/zipdownload.js @@ -37,6 +37,12 @@ export function downLoadZipManage(str, filename,fun) { headers: { 'Authorization': 'Bearer ' + getCookieForName("token") } }).then(res => { console.log("downLoadZipManage res nginx ==> ",res) + if(res.headers.ecode == 4){ + //TODO1-1 弹出框 + this.$message.error("权限不足!"); + return; + } + resolveBlob(res, mimeMap.xlsx,filename) if(fun) fun() }) From 4298d71d5104ce10d685caa49883e1d9694c7884 Mon Sep 17 00:00:00 2001 From: gengxin Date: Mon, 10 Mar 2025 19:33:02 +0800 Subject: [PATCH 3/6] =?UTF-8?q?1.=20=E4=BF=A1=E4=BB=BB=E7=AE=A1=E7=90=86?= =?UTF-8?q?=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/zipdownload.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/zipdownload.js b/src/utils/zipdownload.js index 83accd64..286b62a6 100644 --- a/src/utils/zipdownload.js +++ b/src/utils/zipdownload.js @@ -37,12 +37,13 @@ export function downLoadZipManage(str, filename,fun) { headers: { 'Authorization': 'Bearer ' + getCookieForName("token") } }).then(res => { console.log("downLoadZipManage res nginx ==> ",res) + console.log("downLoadZipManage res res.headers.ecode ==> ",res.headers.ecode) if(res.headers.ecode == 4){ //TODO1-1 弹出框 this.$message.error("权限不足!"); + if(fun) fun() return; } - resolveBlob(res, mimeMap.xlsx,filename) if(fun) fun() }) From 7f6bae7c888ba3ed9ae2a533fea28eacc3f05e30 Mon Sep 17 00:00:00 2001 From: gengxin Date: Mon, 10 Mar 2025 19:45:49 +0800 Subject: [PATCH 4/6] =?UTF-8?q?1.=20=E4=BF=A1=E4=BB=BB=E7=AE=A1=E7=90=86?= =?UTF-8?q?=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/zipdownload.js | 5 +++-- src/views/report/TrainingNewManager.vue | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) 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 } From ddd428dbaf8220af5e1708e2fe80bb53f9639285 Mon Sep 17 00:00:00 2001 From: gengxin Date: Mon, 10 Mar 2025 19:51:18 +0800 Subject: [PATCH 5/6] =?UTF-8?q?1.=20=E4=BF=A1=E4=BB=BB=E7=AE=A1=E7=90=86?= =?UTF-8?q?=206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/zipdownload.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/zipdownload.js b/src/utils/zipdownload.js index d5211b58..a7c6f798 100644 --- a/src/utils/zipdownload.js +++ b/src/utils/zipdownload.js @@ -1,7 +1,6 @@ import axios from 'axios' import {getCookieForName} from "@/api/method"; -import ElementUI from 'element-ui'; -import 'element-plus/dist/index.css' + const mimeMap = { @@ -41,6 +40,7 @@ export function downLoadZipManage(str, filename,fun) { console.log("downLoadZipManage res nginx ==> ",res) console.log("downLoadZipManage res res.headers.ecode ==> ",res.headers.ecode) if(res.headers.ecode == 4){ + console.log("downLoadZipManage res res.headers.ecode 进入 ==> ",res.headers.ecode) //TODO1-1 弹出框 if(fun) fun(res.headers.ecode) return; From ab79db0f0466a8855139c12cfcc59e3546a5df84 Mon Sep 17 00:00:00 2001 From: gengxin Date: Mon, 10 Mar 2025 19:57:36 +0800 Subject: [PATCH 6/6] =?UTF-8?q?1.=20=E4=BF=A1=E4=BB=BB=E7=AE=A1=E7=90=86?= =?UTF-8?q?=207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/report/TrainingNewManager.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/report/TrainingNewManager.vue b/src/views/report/TrainingNewManager.vue index ff53f2d1..fdaeb0a4 100644 --- a/src/views/report/TrainingNewManager.vue +++ b/src/views/report/TrainingNewManager.vue @@ -15,14 +15,14 @@ import { computed,onMounted,ref } from "vue"; import { useStore } from "vuex"; import { reportOrgs } from "@/api/indexProject"; import {downLoadZipManage} from "@/utils/zipdownload"; +import { message } from "ant-design-vue"; const downReport = () => { spinning.value = true if(uploadAdmin('training-admin')){ downLoadZipManage(`/admin/project/report/data`,'新任管理者培训数据',function(code){ - if(code == 4){ spinning.value = false; - this.$message.error("权限不足!"); + message.error("权限不足!"); } })