From f542ff0ae05aad24192b34fad4e24376cc99c0a3 Mon Sep 17 00:00:00 2001 From: wx-jincw Date: Mon, 24 Nov 2025 10:08:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=AD=90=E9=9B=86=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/store/modules/permission.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); }