From a69fc5120d5715346c99da176693683f2b45316f Mon Sep 17 00:00:00 2001 From: super_liu <396572590@qq.com> Date: Thu, 14 Apr 2022 16:45:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20There=20is=20no=20way=20the,=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=85=AC=E5=BC=80=E6=90=9C=E7=B4=A2=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=20=E5=A4=96=E9=83=A8=E8=AE=BF=E9=97=AE=20=3F=20and=20?= =?UTF-8?q?&?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 14 +++++++++----- .../searchCenter/pages/advancedSearchExternal.vue | 3 +-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main.js b/src/main.js index 3ed96e7dc..f5a191c4c 100644 --- a/src/main.js +++ b/src/main.js @@ -64,6 +64,7 @@ import VConsole from 'vuex' import isMobile from "./store/isMobile"; // 路由拦截 router.beforeEach(function (to, from, next) { +debugger let toName = to.name if (toName === 'CheckPage') { next() @@ -74,14 +75,17 @@ router.beforeEach(function (to, from, next) { let token = store.state.token let path = to.path; let userName = "" - if((fromName === undefined || fromName === null) && path.indexOf("/standardSearch/All&userName=") !== -1){ - userName = path.split("&")[1].split("=")[1] + if((fromName === undefined || fromName === null) && (path.indexOf("/standardSearch/All&userName=") !== -1 || (path.indexOf("/standardSearch/All") !== -1 && to.query.userName !== undefined))){ + if((path.indexOf("/standardSearch/All") !== -1 && to.query.userName !== undefined)){ + userName = to.query.userName + }else { + userName = path.split("&")[1].split("=")[1] + } window.sessionStorage.clear() }else { if(fromName === 'Home2'){ localStorage.removeItem("external") } - userName = to.query.userName } let requireAuth = to.meta.requireAuth; let taskId = to.query.taskIds; @@ -189,7 +193,7 @@ router.beforeEach(function (to, from, next) { if (taskId !== undefined && taskId !== null && prcId !== undefined && prcId !== null) { extractedVerify(token) }else { - if((fromName === undefined || fromName === null) && (path.indexOf("/standardSearch/All&userName") !== -1 || path.indexOf("/standardSearch/All?userName") !== -1)){ + if((fromName === undefined || fromName === null) && (path.indexOf("/standardSearch/All&userName") !== -1 || (path.indexOf("/standardSearch/All") !== -1 && userName !== undefined))){ extractedLocalStorage("standardSearch/All",userName) localStorage.setItem('external', "external") next('/LoginVerifyNoEncryption') @@ -388,7 +392,7 @@ router.beforeEach(function (to, from, next) { next() } }else { - if((fromName === undefined || fromName === null) && (path.indexOf("/standardSearch/All&userName") !== -1 || path.indexOf("/standardSearch/All?userName") !== -1)) { + if((fromName === undefined || fromName === null) && (path.indexOf("/standardSearch/All&userName") !== -1 || (path.indexOf("/standardSearch/All") !== -1 && userName !== undefined))) { extractedLocalStorage("standardSearch/All",userName) localStorage.setItem('external', "external") next('/LoginVerifyNoEncryption') diff --git a/src/pages/searchCenter/pages/advancedSearchExternal.vue b/src/pages/searchCenter/pages/advancedSearchExternal.vue index e78dac512..2dd3275ef 100644 --- a/src/pages/searchCenter/pages/advancedSearchExternal.vue +++ b/src/pages/searchCenter/pages/advancedSearchExternal.vue @@ -1830,8 +1830,7 @@ this.$router.push({ name: "StandardSearch", params: { - selectKey: "stand", - searchValue: "allvalue" + selectKey: "All" } }); },