Browse Source

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

lifanagju_citu 1 month ago
parent
commit
144144f45c
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/permission.js

+ 4 - 3
src/permission.js

@@ -127,9 +127,10 @@ router.beforeEach(async (to, from, next) => {
         }
         }
       }
       }
     }
     }
-    if (to.fullPath === '/login') {
-      next('/recruitHome')
-      return
+    if (from.path !== '/login' && from.path !== '/') {
+      window.location.reload()
+    } else {
+      next({ path: '/recruitHome' })
     }
     }
     // 获取字典信息
     // 获取字典信息
     // const dictStore = useDictStore()
     // const dictStore = useDictStore()