diff --git a/admin/src/store/modules/permission.js b/admin/src/store/modules/permission.js index 15ee93a..e19a56d 100644 --- a/admin/src/store/modules/permission.js +++ b/admin/src/store/modules/permission.js @@ -164,7 +164,13 @@ function combineRoutes(routers, fromRoutes) { fromRoutes.forEach(frouter => { const findex = routers.findIndex(r => r.path === frouter.path); if (findex > -1) { - combineRoutes(routers[findex].children, frouter.children); + 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); }