#
luxiaotao1123
2024-02-29 c7aa9cc76f90cf4c7510c59e1eff90f762cf400d
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')
    })
}