|
|
|
@@ -2,7 +2,7 @@ import { MenuDataItem } from '@ant-design/pro-components'; |
|
|
|
import { request } from '@umijs/max'; |
|
|
|
import React, { lazy } from 'react'; |
|
|
|
|
|
|
|
let remoteMenu: any = null; |
|
|
|
let remoteMenu: any = []; |
|
|
|
|
|
|
|
export function getRemoteMenu() { |
|
|
|
return remoteMenu; |
|
|
|
@@ -22,6 +22,7 @@ function patchRouteItems(route: any, menu: any, parentPath: string) { |
|
|
|
if (routeChild.path === menuItem.path) { |
|
|
|
hasItem = true; |
|
|
|
newItem = routeChild; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!hasItem) { |
|
|
|
@@ -42,7 +43,7 @@ function patchRouteItems(route: any, menu: any, parentPath: string) { |
|
|
|
path += '/'; |
|
|
|
} |
|
|
|
if (name !== 'index') { |
|
|
|
path += name.at(0)?.toUpperCase() + name.substr(1); |
|
|
|
path += name.at(0)?.toUpperCase() + name.substring(1); |
|
|
|
} else { |
|
|
|
path += name; |
|
|
|
} |
|
|
|
@@ -101,10 +102,8 @@ export function convertCompatRouters(childrens: API.RoutersMenuItem[]): any[] { |
|
|
|
return childrens.map((item: API.RoutersMenuItem) => { |
|
|
|
return { |
|
|
|
path: item.path, |
|
|
|
// icon:'icon-a-057_fenlei', |
|
|
|
icon: 'icon-' + item.meta.icon, |
|
|
|
// icon: item.meta.icon, |
|
|
|
name: item.meta.title, |
|
|
|
icon: item.meta?.icon ? 'icon-' + item.meta.icon : undefined, |
|
|
|
name: item.meta?.title, |
|
|
|
routes: item.children ? convertCompatRouters(item.children) : undefined, |
|
|
|
hideChildrenInMenu: item.hidden, |
|
|
|
hideInMenu: item.hidden, |
|
|
|
|