From fd116eeded4838248d67988bb9a045aae253dd57 Mon Sep 17 00:00:00 2001 From: onceyoung Date: Thu, 10 Jan 2019 13:57:02 +0800 Subject: [PATCH] forEach should be used instead of map (#3332) --- src/layouts/BasicLayout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index d5306093..914f47f8 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -99,7 +99,7 @@ class BasicLayout extends React.PureComponent { getRouterAuthority = (pathname, routeData) => { let routeAuthority = ['noAuthority']; const getAuthority = (key, routes) => { - routes.map(route => { + routes.forEach(route => { if (route.path && pathToRegexp(route.path).test(key)) { routeAuthority = route.authority; } else if (route.routes) { -- GitLab