|
|
@@ -141,6 +141,12 @@ 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' })
|
|
|
+ // }
|
|
|
+
|
|
|
next({ path: '/index' })
|
|
|
} else if (whiteList.indexOf(to.path) !== -1) {
|
|
|
const code = to.query.code
|
|
|
@@ -155,7 +161,13 @@ router.beforeEach(async (to, from, next) => {
|
|
|
}
|
|
|
// next()
|
|
|
} else {
|
|
|
- next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
|
|
+ const source = to.query.source
|
|
|
+ if (source) {
|
|
|
+ sessionStorage.setItem('LOGIN_SOURCE', source as string)
|
|
|
+ }
|
|
|
+ if (source) {
|
|
|
+ next(`/login?redirect=/oli-connection/monitoring`)
|
|
|
+ } else next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
|
|
}
|
|
|
}
|
|
|
})
|