修复登录后首页入口跳转问题
This commit is contained in:
@@ -69,6 +69,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
import { ApiError } from '@/services/httpClient'
|
||||
import { useAuthStore } from '@/stores/authStore'
|
||||
import { resolveLoginRedirectPath } from '@/utils/authNavigation'
|
||||
|
||||
const { t } = useI18n()
|
||||
const route = useRoute()
|
||||
@@ -99,11 +100,7 @@ async function submitLogin(): Promise<void> {
|
||||
}
|
||||
|
||||
function resolveRedirectPath(): string {
|
||||
const redirect = route.query.redirect
|
||||
if (typeof redirect === 'string' && redirect.startsWith('/') && !redirect.startsWith('//')) {
|
||||
return redirect === '/login' ? authStore.firstMenuPath ?? '/reservation/orders' : redirect
|
||||
}
|
||||
return authStore.firstMenuPath ?? '/reservation/orders'
|
||||
return resolveLoginRedirectPath(route.query.redirect, authStore.firstMenuPath)
|
||||
}
|
||||
|
||||
function loginErrorMessage(error: unknown): string {
|
||||
|
||||
Reference in New Issue
Block a user