Commit fd116eed authored by onceyoung's avatar onceyoung Committed by 陈帅

forEach should be used instead of map (#3332)

parent be6f46de
...@@ -99,7 +99,7 @@ class BasicLayout extends React.PureComponent { ...@@ -99,7 +99,7 @@ class BasicLayout extends React.PureComponent {
getRouterAuthority = (pathname, routeData) => { getRouterAuthority = (pathname, routeData) => {
let routeAuthority = ['noAuthority']; let routeAuthority = ['noAuthority'];
const getAuthority = (key, routes) => { const getAuthority = (key, routes) => {
routes.map(route => { routes.forEach(route => {
if (route.path && pathToRegexp(route.path).test(key)) { if (route.path && pathToRegexp(route.path).test(key)) {
routeAuthority = route.authority; routeAuthority = route.authority;
} else if (route.routes) { } else if (route.routes) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment