feat(admin): 实现动态路由菜单并修复rbac菜单树构建问题

- 修复rbac.py中菜单树构建逻辑,将`elif not menu.parentId`改为`else`,避免父菜单不存在时子菜单丢失
- 新增后端`/api/admin/system/routers`接口,作为动态路由菜单的API
- 前端新增`getRouters` API并整合到用户信息加载流程
- 添加菜单扁平化工具函数,更新路由注册逻辑以支持嵌套路由
- 新增相关测试用例并更新API和集成文档
This commit is contained in:
duanshuwen committed 2026-08-27 00:02:33 +08:00
1 parent f087663b5b
commit 2c8c327de7
12 files changed
+108 -5

No files matched your search

+3 -1
View File
@@ -18,7 +18,9 @@ export const useAuthStore = defineStore("auth", () => {
}
async function loadProfile() {
applyProfile(await api.getProfile());
const profile = await api.getProfile();
applyProfile(profile);
menus.value = await api.getRouters();
}
async function bootstrap() {