From d59f518f466274b2caeb2e01c10c92deafe7c93b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 09 二月 2022 11:48:29 +0800
Subject: [PATCH] 2022-02-09

---
 src/components/header/index.jsx |   66 ++++++++++++++++++--------------
 1 files changed, 37 insertions(+), 29 deletions(-)

diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx
index 281b65e..dca77b8 100644
--- a/src/components/header/index.jsx
+++ b/src/components/header/index.jsx
@@ -4,7 +4,8 @@
 import {connect} from 'react-redux'
 import { is, fromJS } from 'immutable'
 import moment from 'moment'
-import { Dropdown, Menu, Icon, Modal, Form, notification, Switch, Input } from 'antd'
+import { Dropdown, Menu, Modal, Form, notification, Switch, Input } from 'antd'
+import { SearchOutlined, DownOutlined, MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons'
 
 import {
   toggleCollapse,
@@ -142,31 +143,33 @@
     // 鑾峰彇瑙掕壊鏉冮檺
     let roledefer = new Promise(resolve => {
       // edition_type 鎺ュ彛鐗堟湰鎺у埗 ''銆�'Y'銆�'A'
-      Api.getSystemConfig({
-        func: 's_Get_TrdMenu_Role',
-        edition_type: 'A',
-        pro_sys: window.GLOB.systemType === 'production' ? 'Y' : ''
-      }).then(result => {
-        let _permAction = {loaded: true} // 鎸夐挳鏉冮檺
-
-        if (result && result.status) {
-          if (result.UserRoles_Menu) {
-            result.UserRoles_Menu.forEach(menu => {
-              if (!menu.MenuID) return
-              _permAction[menu.MenuID] = true
+      setTimeout(() => {
+        Api.getSystemConfig({
+          func: 's_Get_TrdMenu_Role',
+          edition_type: 'A',
+          pro_sys: window.GLOB.systemType === 'production' ? 'Y' : ''
+        }).then(result => {
+          let _permAction = {loaded: true} // 鎸夐挳鏉冮檺
+  
+          if (result && result.status) {
+            if (result.UserRoles_Menu) {
+              result.UserRoles_Menu.forEach(menu => {
+                if (!menu.MenuID) return
+                _permAction[menu.MenuID] = true
+              })
+            }
+          } else if (result) {
+            notification.error({
+              top: 92,
+              message: result.message,
+              duration: 10
             })
           }
-        } else if (result) {
-          notification.error({
-            top: 92,
-            message: result.message,
-            duration: 10
-          })
-        }
-
-        this.props.initActionPermission(_permAction)
-        resolve()
-      })
+  
+          this.props.initActionPermission(_permAction)
+          resolve()
+        })
+      }, 50)
     })
 
     // 鑾峰彇涓昏彍鍗曞弬鏁�
@@ -403,6 +406,12 @@
           sessionStorage.setItem('role_id', res.role_id || '')
           sessionStorage.setItem('dataM', res.dataM ? 'true' : '')
           sessionStorage.setItem('isEditState', 'true')
+
+          if (param.remember) {
+            let _url = window.location.href.split('#')[0] + 'cloud'
+
+            localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: param.password}))))
+          }
 
           this.setSystemFuncs()
           this.props.modifyMainMenu(null)
@@ -693,7 +702,7 @@
       <header className="header-container ant-menu-dark" id="main-header-container">
         <div className={'header-logo ' + (collapse && navBar !== 'topmenu' ? 'collapse' : '')}><img src={this.state.logourl} alt=""/></div>
         <div className={'header-collapse ' + (collapse && navBar !== 'topmenu' ? 'collapse' : '')}>
-          {navBar !== 'topmenu' ? <Icon type={collapse ? 'menu-unfold' : 'menu-fold'} onClick={this.handleCollapse}/> : null}
+          {navBar !== 'topmenu' ? (collapse ? <MenuUnfoldOutlined onClick={this.handleCollapse}/> : <MenuFoldOutlined onClick={this.handleCollapse}/>) : null}
         </div>
         {/* 姝e父鑿滃崟 */}
         {navBar !== 'topmenu' && menulist ?
@@ -793,7 +802,7 @@
           <div>
             <img src={this.state.avatar || avatar} alt=""/>
             <span>
-              <span className="username">{this.state.userName}</span> <Icon type="down" />
+              <span className="username">{this.state.userName}</span> <DownOutlined />
             </span>
           </div>
         </Dropdown>
@@ -830,7 +839,7 @@
               </div>
             </div>
           } trigger={['click']} className="search-menu" placement="bottomRight" onVisibleChange={this.dropdownMenuChange}>
-            <Icon className="search-menu" type="search" />
+            <SearchOutlined className="search-menu" />
           </Dropdown> : null
         }
         {/* 淇敼瀵嗙爜 */}
@@ -864,8 +873,7 @@
 const mapStateToProps = (state) => {
   return {
     collapse: state.collapse,
-    mainMenu: state.mainMenu,
-    permAction: state.permAction,
+    mainMenu: state.mainMenu
   }
 }
 

--
Gitblit v1.8.0