From c98e45bfac25e9110ad0383faac54a54d98ea9d5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 18 十一月 2021 20:47:04 +0800
Subject: [PATCH] 2021-11-18

---
 src/components/header/index.jsx |   63 +++++++++++++++++--------------
 1 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx
index 0c8f549..952e442 100644
--- a/src/components/header/index.jsx
+++ b/src/components/header/index.jsx
@@ -13,6 +13,7 @@
   initMenuPermission,
   logout
 } from '@/store/action'
+import asyncComponent from '@/utils/asyncComponent'
 import Api from '@/api'
 import MKEmitter from '@/utils/events.js'
 import options from '@/store/options.js'
@@ -20,12 +21,12 @@
 import enUS from '@/locales/en-US/main.js'
 import Utils from '@/utils/utils.js'
 import avatar from '@/assets/img/avatar.jpg'
-import Resetpwd from './resetpwd'
-import LoginForm from './loginform'
 import './index.scss'
 
 const { confirm } = Modal
 const { Search } = Input
+const Resetpwd = asyncComponent(() => import('./resetpwd'))
+const LoginForm = asyncComponent(() => import('./loginform'))
 
 class Header extends Component {
   static propTpyes = {
@@ -87,9 +88,14 @@
         if (result.status) {
           notification.success({
             top: 92,
-            message: this.state.dict['main.password.resetsuccess'],
+            message: '淇敼鎴愬姛锛岃閲嶆柊鐧诲綍銆�',
             duration: 2
           })
+          setTimeout(() => {
+            sessionStorage.clear()
+            this.props.logout()
+            this.props.history.replace('/login')
+          }, 2000)
         } else {
           notification.warning({
             top: 92,
@@ -136,31 +142,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)
     })
 
     // 鑾峰彇涓昏彍鍗曞弬鏁�
@@ -858,8 +866,7 @@
 const mapStateToProps = (state) => {
   return {
     collapse: state.collapse,
-    mainMenu: state.mainMenu,
-    permAction: state.permAction,
+    mainMenu: state.mainMenu
   }
 }
 

--
Gitblit v1.8.0