|
|
@@ -113,6 +113,11 @@ router.beforeEach(async (to, from, next) => {
|
|
|
next({ path: '/video_center/protocol' })
|
|
|
}
|
|
|
|
|
|
+ if (source && source === 'qhse') {
|
|
|
+ sessionStorage.setItem('LOGIN_SOURCE', source as string)
|
|
|
+ next({ path: '/qhse/ledger' })
|
|
|
+ }
|
|
|
+
|
|
|
next({ path: '/' })
|
|
|
} else {
|
|
|
// 获取所有字典
|
|
|
@@ -124,6 +129,7 @@ router.beforeEach(async (to, from, next) => {
|
|
|
}
|
|
|
|
|
|
if (!userStore.getIsSetUser) {
|
|
|
+ console.log(from, to)
|
|
|
isRelogin.show = true
|
|
|
await userStore.setUserInfoAction()
|
|
|
isRelogin.show = false
|
|
|
@@ -151,11 +157,26 @@ router.beforeEach(async (to, from, next) => {
|
|
|
|
|
|
authUtil.setToken(res)
|
|
|
|
|
|
- // const source = to.query.source
|
|
|
- // if (source) {
|
|
|
- // sessionStorage.setItem('LOGIN_SOURCE', source as string)
|
|
|
- // next({ path: '/oli-connection/monitoring' })
|
|
|
- // }
|
|
|
+ const source = to.query.source
|
|
|
+ if (source && source === 'zhly') {
|
|
|
+ sessionStorage.setItem('LOGIN_SOURCE', source as string)
|
|
|
+ next({ path: '/oli-connection/monitoring' })
|
|
|
+ }
|
|
|
+
|
|
|
+ if (source && source === 'znzq') {
|
|
|
+ sessionStorage.setItem('LOGIN_SOURCE', source as string)
|
|
|
+ next({ path: '/device_monitor' })
|
|
|
+ }
|
|
|
+
|
|
|
+ if (source && source === 'spzx') {
|
|
|
+ sessionStorage.setItem('LOGIN_SOURCE', source as string)
|
|
|
+ next({ path: '/video_center/protocol' })
|
|
|
+ }
|
|
|
+
|
|
|
+ if (source && source === 'qhse') {
|
|
|
+ sessionStorage.setItem('LOGIN_SOURCE', source as string)
|
|
|
+ next({ path: '/qhse/ledger' })
|
|
|
+ }
|
|
|
|
|
|
next({ path: '/index' })
|
|
|
} else if (whiteList.indexOf(to.path) !== -1) {
|
|
|
@@ -175,8 +196,14 @@ router.beforeEach(async (to, from, next) => {
|
|
|
if (source) {
|
|
|
sessionStorage.setItem('LOGIN_SOURCE', source as string)
|
|
|
}
|
|
|
- if (source) {
|
|
|
+ if (source && source === 'zhly') {
|
|
|
next(`/login?redirect=/oli-connection/monitoring`)
|
|
|
+ } else if (source && source === 'znzq') {
|
|
|
+ next(`/login?redirect=/device_monitor`)
|
|
|
+ } else if (source && source === 'spzx') {
|
|
|
+ next(`/login?redirect=/video_center/protocol`)
|
|
|
+ } else if (source && source === 'qhse') {
|
|
|
+ next(`/login?redirect=/qhse/ledger`)
|
|
|
} else next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
|
|
}
|
|
|
}
|