From 016ff79d3b516309aaa8a5e1ef3114a431d7e86e Mon Sep 17 00:00:00 2001 From: zyn Date: Wed, 22 Nov 2023 16:50:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20idm=E7=99=BB=E5=BD=95=E4=B8=8D=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=88=B0=E6=90=9C=E7=B4=A2=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/main.js b/src/main.js index 48bd5fee0..d07690061 100644 --- a/src/main.js +++ b/src/main.js @@ -67,13 +67,6 @@ import { Loading } from 'element-ui'; // 路由拦截 router.beforeEach(function (to, from, next) { - // const currentURL = window.location.href - // if (currentURL.indexOf('#/') > 0) { - // const index = currentURL.indexOf('#/') - // const startUrl = currentURL.slice(0, index) - // const endUrl = currentURL.slice(index + 2) - // window.location.href = startUrl + endUrl - // } closeLoading() if (isMobile()){ var loading = Loading.service({ @@ -93,8 +86,6 @@ router.beforeEach(function (to, from, next) { if(fromName === undefined || fromName === null){ window.sessionStorage.clear() } - console.log(to) - console.log(from) let toName = to.name if (toName === 'CheckPage' || toName === 'loginStandDetails' || toName === 'error' || toName === 'LoginVerifyPhone') { @@ -110,6 +101,7 @@ 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 || (path.indexOf("/standardSearch/All") !== -1 && to.query.userName !== undefined))){ if((path.indexOf("/standardSearch/All") !== -1 && to.query.userName !== undefined)){ userName = to.query.userName @@ -118,10 +110,13 @@ router.beforeEach(function (to, from, next) { } window.sessionStorage.clear() }else { + */ if(fromName === 'Home2'){ localStorage.removeItem("external") } + /* } + */ let requireAuth = to.meta.requireAuth; let taskId = to.query.taskIds; let prcId = to.query.prcId; @@ -315,25 +310,33 @@ 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") !== -1 && userName !== undefined))){ extractedLocalStorage("standardSearch/All",userName) localStorage.setItem('external', "external") next('/LoginVerifyNoEncryption') closeLoading() }else { + */ if (toName === 'LoginVerifyNoEncryption') { next() closeLoading() }else { + /* if(path === '/standardSearch/All'){ extractedLocalStorage('standardSearch/All',''); }else { + */ extractedLocalStorage('home2',''); + /* } + */ // ssoLoginUrlDev 默认sso 地址 window.location.href = ssoLoginUrlDev } + /* } + */ } } }else if(webLoginType != null && webLoginType === 'dev'){ @@ -487,15 +490,19 @@ router.beforeEach(function (to, from, next) { closeLoading() } }else { + /* 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') closeLoading() }else { + */ next() closeLoading() + /* } + */ } } })