From f4038a2dc027057fb374314e55b49972f9b26d9d Mon Sep 17 00:00:00 2001 From: xlsea Date: Thu, 24 Jul 2025 17:36:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(projects):=20=E4=BF=AE=E5=A4=8D=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E7=BB=93=E6=9E=84=E5=8F=98=E5=8A=A8=E5=90=8E=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E6=97=A0=E6=B3=95=E8=BF=9B=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/route/index.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/store/modules/route/index.ts b/src/store/modules/route/index.ts index a1a848a7..146e8140 100644 --- a/src/store/modules/route/index.ts +++ b/src/store/modules/route/index.ts @@ -65,11 +65,13 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => { routes.forEach(route => { if (authRouteMode.value === 'dynamic') { - if (route.path === '/') { - route.children?.forEach(child => { - parseRouter(child); - authRoutesMap.set(child.name, child); - }); + if (route.path === '/' && route.children?.length) { + const child = route.children[0]; + parseRouter(child); + child.name = Math.random().toString(36).slice(2, 12); + Object.assign(route, child); + delete route.children; + authRoutesMap.set(route.name, route); return; } parseRouter(route);