diff --git a/src/common/router.js b/src/common/router.js index df247acdbc65a188c04a430f094ec82b556a0c88..269ed7a7cf0f1fe091edafec6c83d82055644aa6 100644 --- a/src/common/router.js +++ b/src/common/router.js @@ -204,7 +204,11 @@ export const getRouterData = app => { Object.keys(routerConfig).forEach(path => { // Regular match item name // eg. router /user/:id === /user/chen - const menuKey = findMenuKey(menuData, path); + let menuKey = Object.keys(menuData).find(key => pathToRegexp(path).test(`${key}`)); + const inherited = menuKey == null; + if (menuKey == null) { + menuKey = findMenuKey(menuData, path); + } let menuItem = {}; // If menuKey is not empty if (menuKey) { @@ -219,6 +223,7 @@ export const getRouterData = app => { name: router.name || menuItem.name, authority: router.authority || menuItem.authority, hideInBreadcrumb: router.hideInBreadcrumb || menuItem.hideInBreadcrumb, + inherited, }; routerData[path] = router; }); diff --git a/src/components/PageHeader/index.js b/src/components/PageHeader/index.js index 7a602da0c0d4b8d7a546bf118c9f70ddffecd0bb..df63c8d3f085b7bf321eac377fe12cfad0de6abc 100644 --- a/src/components/PageHeader/index.js +++ b/src/components/PageHeader/index.js @@ -101,6 +101,9 @@ export default class PageHeader extends PureComponent { // Loop data mosaic routing const extraBreadcrumbItems = pathSnippets.map((url, index) => { const currentBreadcrumb = getBreadcrumb(breadcrumbNameMap, url); + if (currentBreadcrumb.inherited) { + return null; + } const isLinkable = index !== pathSnippets.length - 1 && currentBreadcrumb.component; return currentBreadcrumb.name && !currentBreadcrumb.hideInBreadcrumb ? (