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