From 2a7553ab6aa15c1b17cdd8d4b75c2ce99d65dda3 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期四, 29 二月 2024 16:24:38 +0800 Subject: [PATCH] # --- zy-asrs-flow/config/routes.ts | 5 ----- zy-asrs-flow/src/services/route.js | 9 +++++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/zy-asrs-flow/config/routes.ts b/zy-asrs-flow/config/routes.ts index a49816e..a702494 100644 --- a/zy-asrs-flow/config/routes.ts +++ b/zy-asrs-flow/config/routes.ts @@ -27,11 +27,6 @@ ], }, { - path: '/home', - name: 'home', - component: './home', - }, - { path: '*', layout: false, component: './404', diff --git a/zy-asrs-flow/src/services/route.js b/zy-asrs-flow/src/services/route.js index 4ba1bb7..40f194d 100644 --- a/zy-asrs-flow/src/services/route.js +++ b/zy-asrs-flow/src/services/route.js @@ -62,9 +62,15 @@ break; } } + + const rootMenu = { routes: [] } addHomeMenu(remoteMenu); addUserSettingMenu(remoteMenu); - patchRouteItems(proLayout, remoteMenu); + patchRouteItems(rootMenu, remoteMenu); + console.log(rootMenu); + + proLayout.children = proLayout.children.concat(rootMenu.routes); + proLayout.routes = proLayout.routes.concat(rootMenu.routes); } function patchRouteItems(parent, children) { @@ -77,7 +83,6 @@ path: menu.path, element: <Component />, } - parent.children.push(newRoute); parent.routes.push(newRoute); } else { // parent -- Gitblit v1.9.1