|
@@ -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()
|