diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index 4fcdac680e46ab593c28dab791b01615f87833a0..e1a3363fd83461880c37f6fff7c488926f0dbef4 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -134,10 +134,12 @@ export default class BasicLayout extends React.PureComponent { let title = 'Ant Design Pro'; let currRouterData = null; // match params path - Object.keys(routerData).forEach(key => { + Object.keys(routerData).some(key => { if (pathToRegexp(key).test(pathname)) { currRouterData = routerData[key]; + return true; } + return false; }); if (currRouterData && currRouterData.name) { title = `${currRouterData.name} - Ant Design Pro`;