We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8062c3c commit c2bc4b4Copy full SHA for c2bc4b4
packages/effects/access/src/accessible.ts
@@ -42,16 +42,16 @@ async function generateAccessible(
42
delete route.component;
43
}
44
// 根据router name判断,如果路由已经存在,则不再添加
45
- if (!names?.includes(route.name)) {
46
- root.children?.push(route);
47
- } else {
+ if (names?.includes(route.name)) {
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
+ } else {
+ root.children?.push(route);
55
56
} else {
57
router.addRoute(route);
0 commit comments