|
@@ -35,7 +35,7 @@ router.beforeEach((to, from, next) => {
|
|
// param.username = cookie.get('WISEUser')
|
|
// param.username = cookie.get('WISEUser')
|
|
var loginType = cookie.get('EIName')
|
|
var loginType = cookie.get('EIName')
|
|
console.log(loginType)
|
|
console.log(loginType)
|
|
- if(loginType === 'sso'){
|
|
|
|
|
|
+ if(loginType === 'sso' || !loginType){
|
|
store.dispatch('TzLogin').then(response => {
|
|
store.dispatch('TzLogin').then(response => {
|
|
// 有EIToken
|
|
// 有EIToken
|
|
// console.log('pppppppppresult', response)
|
|
// console.log('pppppppppresult', response)
|
|
@@ -77,7 +77,23 @@ router.beforeEach((to, from, next) => {
|
|
})
|
|
})
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- next()
|
|
|
|
|
|
+ // next()
|
|
|
|
+ console.log(from, to)
|
|
|
|
+ // 从添加页面跳转其他页面后需要删除联锁添加页面
|
|
|
|
+ if(from.path === '/interLock/summary/set' && !from.meta.replace){
|
|
|
|
+ // 为了解决循环设置了replace
|
|
|
|
+ from.meta.replace = true
|
|
|
|
+ next({ ...to, replace: true })
|
|
|
|
+ from.meta.replace = false
|
|
|
|
+ } else {
|
|
|
|
+ next()
|
|
|
|
+ }
|
|
|
|
+ // 联锁添加页面刷新--返回联锁总表页面
|
|
|
|
+ if(from.path === '/' && to.path === '/interLock/summary/set'){
|
|
|
|
+ next({ path: '/interLock/summary'})
|
|
|
|
+ } else {
|
|
|
|
+ next()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -100,7 +116,7 @@ router.beforeEach((to, from, next) => {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- if(loginType === 'system' || !loginType){
|
|
|
|
|
|
+ if(loginType === 'system'){
|
|
if (Vue.ls.get(ACCESS_TOKEN)) {
|
|
if (Vue.ls.get(ACCESS_TOKEN)) {
|
|
/* has token */
|
|
/* has token */
|
|
if (to.path === '/user/login' || to.path === OAUTH2_LOGIN_PAGE_PATH) {
|
|
if (to.path === '/user/login' || to.path === OAUTH2_LOGIN_PAGE_PATH) {
|