feat: There is no way the, 配置公开搜索中心 外部访问
This commit is contained in:
+35
-6
@@ -68,8 +68,20 @@ router.beforeEach(function (to, from, next) {
|
||||
if (toName === 'CheckPage') {
|
||||
next()
|
||||
}
|
||||
|
||||
let fromName = from.name
|
||||
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]
|
||||
window.sessionStorage.clear()
|
||||
}else {
|
||||
if(fromName === 'Home2'){
|
||||
localStorage.removeItem("external")
|
||||
}
|
||||
userName = to.query.userName
|
||||
}
|
||||
let requireAuth = to.meta.requireAuth;
|
||||
let taskId = to.query.taskIds;
|
||||
let prcId = to.query.prcId;
|
||||
@@ -109,6 +121,7 @@ router.beforeEach(function (to, from, next) {
|
||||
}
|
||||
|
||||
function extractedLocalStorage(url,param,param4) {
|
||||
localStorage.removeItem("external")
|
||||
localStorage.removeItem("routerUrl")
|
||||
localStorage.setItem('routerUrl', url)
|
||||
localStorage.removeItem("routerParam")
|
||||
@@ -175,13 +188,23 @@ router.beforeEach(function (to, from, next) {
|
||||
if (taskId !== undefined && taskId !== null && prcId !== undefined && prcId !== null) {
|
||||
extractedVerify(token)
|
||||
}else {
|
||||
if(path === '/standardSearch/All'){
|
||||
extractedLocalStorage('standardSearch/All','');
|
||||
if((fromName === undefined || fromName === null) && path.indexOf("/standardSearch/All&userName") !== -1){
|
||||
extractedLocalStorage("standardSearch/All",userName)
|
||||
localStorage.setItem('external', "external")
|
||||
next('/LoginVerifyNoEncryption')
|
||||
}else {
|
||||
extractedLocalStorage('home2','');
|
||||
if (toName === 'LoginVerifyNoEncryption') {
|
||||
next()
|
||||
}else {
|
||||
if(path === '/standardSearch/All'){
|
||||
extractedLocalStorage('standardSearch/All','');
|
||||
}else {
|
||||
extractedLocalStorage('home2','');
|
||||
}
|
||||
// ssoLoginUrlDev 默认sso 地址
|
||||
window.location.href = ssoLoginUrlDev
|
||||
}
|
||||
}
|
||||
// ssoLoginUrlDev 默认sso 地址
|
||||
window.location.href = ssoLoginUrlDev
|
||||
}
|
||||
}
|
||||
}else if(webLoginType != null && webLoginType === 'dev'){
|
||||
@@ -364,7 +387,13 @@ router.beforeEach(function (to, from, next) {
|
||||
next()
|
||||
}
|
||||
}else {
|
||||
next()
|
||||
if((fromName === undefined || fromName === null) && path.indexOf("/standardSearch/All&userName") !== -1) {
|
||||
extractedLocalStorage("standardSearch/All",userName)
|
||||
localStorage.setItem('external', "external")
|
||||
next('/LoginVerifyNoEncryption')
|
||||
}else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user