We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b148b8e commit 740e4c1Copy full SHA for 740e4c1
packages/effects/access/src/accessible.ts
@@ -44,6 +44,14 @@ async function generateAccessible(
44
// 根据router name判断,如果路由已经存在,则不再添加
45
if (!names?.includes(route.name)) {
46
root.children?.push(route);
47
+ } else {
48
+ // 找到已存在的路由索引并更新,不更新会造成切换用户时,一级目录未更新,homePath 在二级目录导致的404问题
49
+ const index = root.children?.findIndex(
50
+ (item) => item.name === route.name,
51
+ );
52
+ if (index !== undefined && index !== -1 && root.children) {
53
+ root.children[index] = route;
54
+ }
55
}
56
} else {
57
router.addRoute(route);
0 commit comments