浏览代码

去除多次查询当前用户的bug

tianyunperfect 4 年之前
父节点
当前提交
fa727995ad
共有 1 个文件被更改,包括 1 次插入12 次删除
  1. 1 12
      src/layouts/BasicLayout.tsx

+ 1 - 12
src/layouts/BasicLayout.tsx

@@ -9,7 +9,7 @@ import ProLayout, {
   Settings,
   Settings,
   DefaultFooter,
   DefaultFooter,
 } from '@ant-design/pro-layout';
 } from '@ant-design/pro-layout';
-import React, { useEffect } from 'react';
+import React from 'react';
 import { Link, useIntl, connect, Dispatch } from 'umi';
 import { Link, useIntl, connect, Dispatch } from 'umi';
 // import { GithubOutlined } from '@ant-design/icons';
 // import { GithubOutlined } from '@ant-design/icons';
 import { Result, Button } from 'antd';
 import { Result, Button } from 'antd';
@@ -81,17 +81,6 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
       pathname: '/',
       pathname: '/',
     },
     },
   } = props;
   } = props;
-  /**
-   * constructor
-   */
-
-  useEffect(() => {
-    if (dispatch) {
-      dispatch({
-        type: 'user/fetchCurrent',
-      });
-    }
-  }, []);
   /**
   /**
    * init variables
    * init variables
    */
    */