From 9eb0c00ed23a0cea8c7e267c35d5d34ae1ef9c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=BF=94=E5=AE=87-=E6=97=85=E7=AE=A1=E5=AE=B6?= <153298343@qq.com> Date: Wed, 17 Aug 2022 16:30:47 +0800 Subject: [PATCH] up --- src/permission.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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