|
|
@ -52,13 +52,16 @@ export type BasicLayoutContext = { [K in 'location']: BasicLayoutProps[K] } & { |
|
|
|
|
|
|
|
|
const menuDataRender = (menuList: MenuDataItem[]): MenuDataItem[] => |
|
|
const menuDataRender = (menuList: MenuDataItem[]): MenuDataItem[] => |
|
|
menuList.map((item) => { |
|
|
menuList.map((item) => { |
|
|
const localItem = { ...item, children: item.children ? menuDataRender(item.children) : [] }; |
|
|
const localItem = { |
|
|
|
|
|
...item, |
|
|
|
|
|
children: item.children ? menuDataRender(item.children) : undefined, |
|
|
|
|
|
}; |
|
|
return Authorized.check(item.authority, localItem, null) as MenuDataItem; |
|
|
return Authorized.check(item.authority, localItem, null) as MenuDataItem; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const defaultFooterDom = ( |
|
|
const defaultFooterDom = ( |
|
|
<DefaultFooter |
|
|
<DefaultFooter |
|
|
copyright={`${(new Date()).getFullYear()} 蚂蚁金服体验技术部出品`} |
|
|
copyright={`${new Date().getFullYear()} 蚂蚁金服体验技术部出品`} |
|
|
links={[ |
|
|
links={[ |
|
|
{ |
|
|
{ |
|
|
key: 'Ant Design Pro', |
|
|
key: 'Ant Design Pro', |
|
|
@ -132,11 +135,9 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => { |
|
|
)} |
|
|
)} |
|
|
onCollapse={handleMenuCollapse} |
|
|
onCollapse={handleMenuCollapse} |
|
|
menuItemRender={(menuItemProps, defaultDom) => { |
|
|
menuItemRender={(menuItemProps, defaultDom) => { |
|
|
if (menuItemProps.isUrl || !menuItemProps.path |
|
|
if (menuItemProps.isUrl || !menuItemProps.path) { |
|
|
|| menuItemProps.children?.length) { |
|
|
|
|
|
return defaultDom; |
|
|
return defaultDom; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return <Link to={menuItemProps.path}>{defaultDom}</Link>; |
|
|
return <Link to={menuItemProps.path}>{defaultDom}</Link>; |
|
|
}} |
|
|
}} |
|
|
breadcrumbRender={(routers = []) => [ |
|
|
breadcrumbRender={(routers = []) => [ |
|
|
|