Ver Fonte

自查bug fix

刘洋 há 2 anos atrás
pai
commit
bee2334944
1 ficheiros alterados com 5 adições e 2 exclusões
  1. 5 2
      src/router/index.ts

+ 5 - 2
src/router/index.ts

@@ -36,7 +36,11 @@ const router = createRouter({
 
 router.beforeEach(async (to, from, next) => {
   const mainStore = useMainStore()
-  if (!mainStore.myUserInfo && sessionStorage.get('LOGIN_RESULT') && to.name !== 'Login') {
+  if (
+    !mainStore.myUserInfo &&
+    sessionStorage.get('LOGIN_RESULT') &&
+    !['Login', 'CheckExam', 'InitCreateExam', 'InitUserName'].includes(String(to.name))
+  ) {
     await mainStore.getMyUserInfo()
   }
   if (
@@ -47,7 +51,6 @@ router.beforeEach(async (to, from, next) => {
     mainStore.myUserInfo?.passwordWeak
   ) {
     console.log('to:', to)
-
     next({ name: 'ChangePassword', query: { redirectPath: encodeURIComponent(to.fullPath) } })
   } else if (to.meta?.auth === false || to.name === 'Login' || sessionStorage.get('LOGIN_RESULT')) {
     next()