ソースを参照

其他平台用户登录平台方不显示侧边栏

zhanghe 6 年 前
コミット
155b43151b
1 ファイル変更11 行追加7 行削除
  1. 11 7
      src/layouts/BasicLayout.js

+ 11 - 7
src/layouts/BasicLayout.js

@@ -12,6 +12,7 @@ import GlobalFooter from '../components/GlobalFooter';
 import SiderMenu from '../components/SiderMenu';
 import NotFound from '../routes/Exception/404';
 import { getRoutes } from '../utils/utils';
+import { getLocalUser } from '../utils/helper';
 import { getMenuData } from '../common/menu';
 
 
@@ -95,16 +96,19 @@ class BasicLayout extends React.PureComponent {
   }
   render() {
     const {
-      currentUser, collapsed, fetchingNotices, notices, routerData, match, location, dispatch,
+      collapsed, fetchingNotices, notices, routerData, match, location, dispatch,
     } = this.props;
+    const currentUser = getLocalUser() || {};
     const layout = (
       <Layout>
-        <SiderMenu
-          collapsed={collapsed}
-          location={location}
-          dispatch={dispatch}
-          isMobile={this.state.isMobile}
-        />
+        {currentUser.platForm &&
+          <SiderMenu
+            collapsed={collapsed}
+            location={location}
+            dispatch={dispatch}
+            isMobile={this.state.isMobile}
+          />
+        }
         <Layout>
           <GlobalHeader
             currentUser={currentUser}