Skip to content

Commit c2bc4b4

Browse files
committed
fix: lint error
1 parent 8062c3c commit c2bc4b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/effects/access/src/accessible.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ async function generateAccessible(
4242
delete route.component;
4343
}
4444
// 根据router name判断,如果路由已经存在,则不再添加
45-
if (!names?.includes(route.name)) {
46-
root.children?.push(route);
47-
} else {
45+
if (names?.includes(route.name)) {
4846
// 找到已存在的路由索引并更新,不更新会造成切换用户时,一级目录未更新,homePath 在二级目录导致的404问题
4947
const index = root.children?.findIndex(
5048
(item) => item.name === route.name,
5149
);
5250
if (index !== undefined && index !== -1 && root.children) {
5351
root.children[index] = route;
5452
}
53+
} else {
54+
root.children?.push(route);
5555
}
5656
} else {
5757
router.addRoute(route);

0 commit comments

Comments
 (0)