fix: 修复路由子集为空

main
wx-jincw 1 week ago
parent 8d62c6fc7e
commit f542ff0ae0

@ -164,7 +164,13 @@ function combineRoutes(routers, fromRoutes) {
fromRoutes.forEach(frouter => {
const findex = routers.findIndex(r => r.path === frouter.path);
if (findex > -1) {
if (frouter.children) {
if (!routers[findex].children || routers[findex].children.length === 0) {
routers[findex].children = frouter.children;
} else {
combineRoutes(routers[findex].children, frouter.children);
}
}
} else {
routers.push(frouter);
}

Loading…
Cancel
Save