From c7aa9cc76f90cf4c7510c59e1eff90f762cf400d Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 29 二月 2024 16:25:39 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/services/route.js |   41 +++++++++++++++++++++++++++++++----------
 1 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/zy-asrs-flow/src/services/route.js b/zy-asrs-flow/src/services/route.js
index 34cbd68..15a6ce8 100644
--- a/zy-asrs-flow/src/services/route.js
+++ b/zy-asrs-flow/src/services/route.js
@@ -62,8 +62,14 @@
             break;
         }
     }
+
+    const rootMenu = { routes: [] }
+    addHomeMenu(remoteMenu);
     addUserSettingMenu(remoteMenu);
-    patchRouteItems(proLayout, remoteMenu);
+    patchRouteItems(rootMenu, remoteMenu);
+
+    proLayout.children = proLayout.children.concat(rootMenu.routes);
+    proLayout.routes = proLayout.routes.concat(rootMenu.routes);
 }
 
 function patchRouteItems(parent, children) {
@@ -76,7 +82,6 @@
                 path: menu.path,
                 element: <Component />,
             }
-            parent.children.push(newRoute);
             parent.routes.push(newRoute);
         } else {
             // parent
@@ -97,17 +102,33 @@
     }
 }
 
+function addHomeMenu(remoteMenu) {
+    remoteMenu.unshift({
+        name: "棣栭〉",
+        path: "/home",
+        component: "/home",
+        icon: createIcon('HomeOutlined')
+    })
+}
+
 function addUserSettingMenu(remoteMenu) {
-    const settingRoute = {
-        name: "涓汉璁剧疆",
-        path: "/account/setting",
-        component: "/account/setting"
-    }
+    // const settingRoute = {
+    //     name: "涓汉璁剧疆",
+    //     path: "/account/setting",
+    //     component: "/account/setting"
+    // }
+    // remoteMenu.push({
+    //     name: "涓汉涓績",
+    //     path: "/account",
+    //     component: null,
+    //     routes: [settingRoute],
+    //     icon: createIcon('UserOutlined')
+    // })
+
     remoteMenu.push({
         name: "涓汉涓績",
-        path: "/account",
-        component: null,
-        routes: [settingRoute],
+        path: "/account/setting",
+        component: "/account/setting",
         icon: createIcon('UserOutlined')
     })
 }
\ No newline at end of file

--
Gitblit v1.9.1