|
|
|
|
@ -76,10 +76,28 @@ router.beforeEach(async (to, from, next) => {
|
|
|
|
|
if (whiteList.indexOf(to.path) !== -1) {
|
|
|
|
|
// in the free login whitelist, go directly
|
|
|
|
|
next()
|
|
|
|
|
} else {
|
|
|
|
|
} else {
|
|
|
|
|
console.log("to",to)
|
|
|
|
|
// other pages that do not have permission to access are redirected to the login page.
|
|
|
|
|
next(`/login?redirect=${to.path}`)
|
|
|
|
|
NProgress.done()
|
|
|
|
|
if (to.query.token && to.query.tp) {
|
|
|
|
|
try {
|
|
|
|
|
await store.dispatch('user/loginskip', {
|
|
|
|
|
token: to.query.token,
|
|
|
|
|
tp: to.query.tp
|
|
|
|
|
})
|
|
|
|
|
console.log("to.path",to.path)
|
|
|
|
|
next(to.path || '/')
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.log("/login",e)
|
|
|
|
|
next('/login')
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// other pages that do not have permission to access are redirected to the login page.
|
|
|
|
|
next(`/login?redirect=${to.path}`)
|
|
|
|
|
NProgress.done()
|
|
|
|
|
}
|
|
|
|
|
// next(`/login?redirect=${to.path}`)
|
|
|
|
|
// NProgress.done()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|