Selaa lähdekoodia

已登录账号点击去登录,刷新当前页面或前往个人首页

lifanagju_citu 1 kuukausi sitten
vanhempi
commit
67dd5d2544
1 muutettua tiedostoa jossa 6 lisäystä ja 4 poistoa
  1. 6 4
      src/permission.js

+ 6 - 4
src/permission.js

@@ -140,10 +140,12 @@ router.beforeEach(async (to, from, next) => {
     if (localStorage.getItem('chooseRole') === 'showChooseRole' && to.path !== '/register/selectedPersonRole' && tokenIndex === 2) next('/register/selectedPersonRole')
     else if (localStorage.getItem('necessaryInfoReady') === 'fddeaddc47868b' && tokenIndex === 2 && localStorage.getItem('chooseRole') !== 'showChooseRole') dialogExtend('necessaryInfoDialog')
     
-    if (from.path !== '/login' && from.path !== '/') {
-      window.location.reload()
-    } else {
-      next({ path: '/recruitHome' })
+    if (to.fullPath === '/login') {
+      if (from.path !== '/login' && from.path !== '/') {
+        window.location.reload()
+      } else {
+        next({ path: '/recruitHome' })
+      }
     }
     next()
     return