From 030ce888cc06898159c51b74745257af1b248d7a 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 09:58:38 +0800 Subject: [PATCH] up --- src/permission.js | 9 +++++---- src/views/rain/inspection/inspection.vue | 19 +++++++++++++++---- src/views/rain/inspection/law.vue | 17 +++++++++++++++-- src/views/rain/maintain/law.vue | 13 +++++++++++++ 4 files changed, 48 insertions(+), 10 deletions(-) diff --git a/src/permission.js b/src/permission.js index 0e124be..2dbbd62 100644 --- a/src/permission.js +++ b/src/permission.js @@ -28,10 +28,11 @@ router.beforeEach(async (to, from, next) => { if (hasToken) { if (to.path === '/login') { - // if is logged in, redirect to the home page - next({ - path: '/' - }) + // if is logged in, redirect to the home page + + await store.dispatch('user/resetToken'); + next(to.fullPath) + NProgress.done() } else { // determine whether the user has obtained his permission roles through getInfo diff --git a/src/views/rain/inspection/inspection.vue b/src/views/rain/inspection/inspection.vue index f8de792..09aafae 100644 --- a/src/views/rain/inspection/inspection.vue +++ b/src/views/rain/inspection/inspection.vue @@ -17,8 +17,6 @@ - - @@ -97,6 +95,9 @@ +
+ {{getUserName(scope.row)}} +
+
+ {{getUserName(scope.row)}} +