mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-03-18 14:28:50 +08:00
fix(router): 修正根路由匹配逻辑和仪表板路由路径
修正根路由匹配逻辑,从基于路径匹配改为同时检查名称和路径,以避免潜在的路由冲突。同时将仪表板模块的基础路径从'/'改为'/dashboard',以改善路由结构。
This commit is contained in:
@@ -29,7 +29,9 @@ async function generateAccessible(
|
||||
// 生成路由
|
||||
const accessibleRoutes = await generateRoutes(mode, options);
|
||||
|
||||
const root = router.getRoutes().find((item) => item.path === '/');
|
||||
const root = router
|
||||
.getRoutes()
|
||||
.find((item) => item.name === 'Root' && item.path === '/');
|
||||
|
||||
// 获取已有的路由名称列表
|
||||
const names = root?.children?.map((item) => item.name) ?? [];
|
||||
|
||||
Reference in New Issue
Block a user