修复登录后首页入口跳转问题

This commit is contained in:
andy
2026-07-10 10:28:04 +08:00
parent 25efcccf72
commit 9de4f0e7b6
8 changed files with 132 additions and 20 deletions

View File

@@ -12,6 +12,7 @@ import type {
AuthPermissionCode,
AuthUserResult,
} from '@/types/auth'
import { normalizeAuthenticatedRoutePath } from '@/utils/authNavigation'
interface AuthState {
accessToken: string | null
@@ -43,7 +44,7 @@ export const useAuthStore = defineStore('auth', {
state.hotels.find((hotel) => hotel.hotel_id === state.selectedHotelId) ?? state.hotels[0] ?? null,
visibleMenus: (state) =>
[...state.menus]
.filter((menu) => Boolean(menu.route_path))
.filter((menu) => normalizeAuthenticatedRoutePath(menu.route_path))
.sort((left, right) => (left.sort_order ?? 0) - (right.sort_order ?? 0)),
firstMenuPath(): string | null {
return this.visibleMenus[0]?.route_path ?? null