|
|
|
@ -30,9 +30,10 @@ router.beforeEach(async (to, from, next) => {
|
|
|
|
if (hasToken) {
|
|
|
|
if (hasToken) {
|
|
|
|
if (to.path === '/login') {
|
|
|
|
if (to.path === '/login') {
|
|
|
|
// if is logged in, redirect to the home page
|
|
|
|
// if is logged in, redirect to the home page
|
|
|
|
next({
|
|
|
|
|
|
|
|
path: '/'
|
|
|
|
await store.dispatch('user/resetToken');
|
|
|
|
})
|
|
|
|
next(to.fullPath);
|
|
|
|
|
|
|
|
|
|
|
|
NProgress.done()
|
|
|
|
NProgress.done()
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// determine whether the user has obtained his permission roles through getInfo
|
|
|
|
// determine whether the user has obtained his permission roles through getInfo
|
|
|
|
|