修复前端登录权限边界问题

This commit is contained in:
andy committed 2026-07-10 09:35:47 +08:00
1 parent e49b2ccc1d
commit 25efcccf72
11 files changed
+282 -15

No files matched your search

+8 -3
View File
@@ -15,9 +15,10 @@ export const router = createRouter({
routes: [
{
path: '/',
redirect: () => {
const authStore = useAuthStore()
return authStore.firstMenuPath ?? '/reservation/orders'
name: 'home',
component: {
name: 'HomeRedirectView',
render: () => null,
},
},
{
@@ -126,6 +127,10 @@ export function createAuthGuard(resolveAuthStore: () => AuthStore = () => useAut
}
}
if (to.path === '/') {
return authStore.firstMenuPath ?? '/reservation/orders'
}
if (meta.permission && !authStore.hasPermission(meta.permission)) {
return {
name: 'unauthorized',