修复登录后首页入口跳转问题
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user