From d046987ec3f5473763de163b3ed04f96a7c0156d Mon Sep 17 00:00:00 2001 From: xvv Date: Mon, 5 Aug 2024 15:21:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fuintAdmin/src/store/modules/user.js | 4 ++++ fuintAdmin_zt/src/layout/components/Sidebar/SidebarItem.vue | 2 ++ fuintAdmin_zt/src/store/modules/user.js | 6 +++++- fuintAdmin_zt/src/views/login.vue | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/fuintAdmin/src/store/modules/user.js b/fuintAdmin/src/store/modules/user.js index 87f2eb676..b0e697b45 100644 --- a/fuintAdmin/src/store/modules/user.js +++ b/fuintAdmin/src/store/modules/user.js @@ -54,6 +54,10 @@ const user = { const uuid = userInfo.uuid return new Promise((resolve, reject) => { login(username, password, captchaCode, uuid).then(res => { + if(res.data.token == null ){ + this.$router.push({ path: '/login' }); + return + } console.log("user_58",res.data) // dutyRoleCode diff --git a/fuintAdmin_zt/src/layout/components/Sidebar/SidebarItem.vue b/fuintAdmin_zt/src/layout/components/Sidebar/SidebarItem.vue index 6ddd86526..e02bd69a4 100644 --- a/fuintAdmin_zt/src/layout/components/Sidebar/SidebarItem.vue +++ b/fuintAdmin_zt/src/layout/components/Sidebar/SidebarItem.vue @@ -209,6 +209,7 @@ export default { }, methods: { hasOneShowingChild(children = [], parent) { + console.log('212') if (!children) { children = []; } @@ -236,6 +237,7 @@ export default { return false }, resolvePath(routePath, routeQuery) { + console.log('240') if (isExternal(routePath)) { return routePath } diff --git a/fuintAdmin_zt/src/store/modules/user.js b/fuintAdmin_zt/src/store/modules/user.js index 22e8f4112..c0718d01f 100644 --- a/fuintAdmin_zt/src/store/modules/user.js +++ b/fuintAdmin_zt/src/store/modules/user.js @@ -54,11 +54,15 @@ const user = { const uuid = userInfo.uuid return new Promise((resolve, reject) => { login(username, password, captchaCode, uuid).then(res => { - + if(res.data.token == null ){ + this.$router.push({ path: '/login' }); + return + } console.log("user_58",res.data) if (res.data.ownerId !== "3") { setToken(res.data.token) + commit('SET_TOKEN', res.data.token) // Cookies.remove('IS_BK_LOGIN'); sessionStorage.removeItem('IS_BK_LOGIN'); diff --git a/fuintAdmin_zt/src/views/login.vue b/fuintAdmin_zt/src/views/login.vue index 60d02d51e..916a645ec 100644 --- a/fuintAdmin_zt/src/views/login.vue +++ b/fuintAdmin_zt/src/views/login.vue @@ -286,6 +286,7 @@ export default { console.log("dataJSON",data) location.replace(this.bkUrl+"resource_oilstore?token="+data.token); }else { + app.$router.push({ path: "/Service/index" }).catch(()=>{}); }