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" } }); },