瀏覽代碼

forEach should be used instead of map (#3332)

onceyoung 7 年之前
父節點
當前提交
fd116eeded
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/layouts/BasicLayout.js

+ 1 - 1
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) {