diff --git a/src/components/PageHeader/index.js b/src/components/PageHeader/index.js index ed86137d0982aa8783fcdf20a8f0ae011649c390..8efba9ca9e1da4ca74d3f185e243439cbd9dad1a 100644 --- a/src/components/PageHeader/index.js +++ b/src/components/PageHeader/index.js @@ -9,13 +9,15 @@ import styles from './index.less'; const { TabPane } = Tabs; function getBreadcrumb(breadcrumbNameMap, url) { - let breadcrumb = {}; - Object.keys(breadcrumbNameMap).forEach((item) => { - if (pathToRegexp(item).test(url)) { - breadcrumb = breadcrumbNameMap[item]; - } - }); - return breadcrumb; + let breadcrumb = breadcrumbNameMap[url]; + if (!breadcrumb) { + Object.keys(breadcrumbNameMap).forEach((item) => { + if (pathToRegexp(item).test(url)) { + breadcrumb = breadcrumbNameMap[item]; + } + }); + } + return breadcrumb || {}; } export default class PageHeader extends PureComponent {