From da64ab0923bf8817fc8599a6e37b953ce38f64c8 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 27 八月 2023 18:37:36 +0800
Subject: [PATCH] 2023-08-27

---
 src/views/design/header/index.jsx |   51 +++++++++++++--------------------------------------
 1 files changed, 13 insertions(+), 38 deletions(-)

diff --git a/src/views/design/header/index.jsx b/src/views/design/header/index.jsx
index 2155478..3fe5ad4 100644
--- a/src/views/design/header/index.jsx
+++ b/src/views/design/header/index.jsx
@@ -1,22 +1,14 @@
 import React, {Component} from 'react'
 import { withRouter } from 'react-router-dom'
-import {connect} from 'react-redux'
 import { Dropdown, Menu, Modal, notification, Switch, Button, Popover } from 'antd'
 import { MenuFoldOutlined, SettingOutlined, AppstoreOutlined, DownOutlined, HomeOutlined, ApiOutlined, PlusOutlined, EditOutlined, MenuOutlined, DatabaseOutlined } from '@ant-design/icons'
 import moment from 'moment'
 
-import asyncComponent from '@/utils/asyncComponent'
-import {
-  modifyMenuTree,
-  modifyMainMenu,
-  resetEditLevel,
-  logout
-} from '@/store/action'
 import Api from '@/api'
-import options from '@/store/options.js'
 import Utils from '@/utils/utils.js'
 import avatar from '@/assets/img/avatar.jpg'
 import MainLogo from '@/assets/img/main-logo.png'
+import asyncComponent from '@/utils/asyncComponent'
 import MKEmitter from '@/utils/events.js'
 import './index.scss'
 
@@ -44,7 +36,6 @@
       content: '',
       onOk() {
         sessionStorage.clear()
-        _this.props.logout()
         _this.props.history.replace('/login')
       },
       onCancel() {}
@@ -64,12 +55,12 @@
     // 鑾峰彇涓昏彍鍗�
     let _param = {
       func: 's_get_pc_menus',
-      systemType: options.sysType,
+      systemType: window.GLOB.sysType,
       pro_sys: window.GLOB.systemType === 'production' ? 'Y' : '',
       debug: 'Y'
     }
 
-    let result = await Api.getSystemConfig(_param)
+    let result = await Api.getCloudConfig(_param)
 
     // 鐧诲綍瓒呮椂
     if (!result) return
@@ -189,6 +180,7 @@
   }
 
   changeEditState = () => {
+    sessionStorage.removeItem('isEditState')
     this.props.history.replace('/main')
     window.location.reload()
   }
@@ -214,7 +206,7 @@
       this.setState({
         loading: true
       })
-      Api.getSystemConfig(param).then(res => {
+      Api.getCloudConfig(param).then(res => {
         if (res.status) {
           this.setState({
             loading: false,
@@ -319,7 +311,7 @@
       param.secretkey = Utils.encrypt(param.LText, param.timestamp)
       param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 浜戠鏁版嵁楠岃瘉
       
-      Api.getSystemConfig(param).then(res => {
+      Api.getCloudConfig(param).then(res => {
         let msgs = []
         if (!res.status) {
           notification.warning({
@@ -336,7 +328,6 @@
   }
   
   UNSAFE_componentWillMount () {
-    sessionStorage.setItem('isEditState', 'true')
     document.body.className = ''
     
     // 缁勪欢鍔犺浇鏃讹紝鑾峰彇鑿滃崟鏁版嵁
@@ -357,7 +348,7 @@
 
     if (window.GLOB.systemType !== 'production') {
       setTimeout(() => {
-        Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => {
+        Api.getCloudConfig({func: 'sPC_Get_Roles_sModular'}).then(res => {
           if (res.status) {
             let _permFuncField = []
             let _sysRoles = []
@@ -388,7 +379,8 @@
       }, 100)
 
       setTimeout(() => {
-        this.setSystemFuncs()
+        // positecgroup
+        // this.setSystemFuncs()
         this.getSmStemp()
       }, 500)
     }
@@ -405,11 +397,11 @@
   }
 
   gotoDoc = () => {
-    if (options.sysType === 'local' && window.GLOB.mainSystemApi) {
+    if (window.GLOB.sysType === 'local' && window.GLOB.mainSystemApi) {
       let ssodomain = window.GLOB.mainSystemApi.replace('/webapi/dostars', '')
       let url = `${ssodomain}/doc/index.html#?appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}`
       window.open(url)
-    } else if (options.sysType === 'SSO' || options.sysType === 'cloud') {
+    } else if (window.GLOB.sysType === 'SSO' || window.GLOB.sysType === 'cloud') {
       window.open(`${window.location.href.replace(/\/index.html(.*)|\/#(.*)/ig, '')}/doc/index.html#?appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}`)
     }
   }
@@ -511,7 +503,7 @@
               <Switch size="small" style={{marginLeft: '7px'}} disabled={!!editLevel} checked={true} onChange={this.changeEditState} />
             </Menu.Item>
             <Menu.Item key="doc" onClick={this.gotoDoc}>鏂囨。涓績</Menu.Item>
-            {options.sysType !== 'cloud' ? <Menu.Item style={{padding: 0}} key="verup">
+            {window.GLOB.sysType !== 'cloud' ? <Menu.Item style={{padding: 0}} key="verup">
               <VersionsUp />
             </Menu.Item> : null}
             <Menu.Item key="logout" onClick={this.logout}>閫�鍑�</Menu.Item>
@@ -543,21 +535,4 @@
   }
 }
 
-const mapStateToProps = (state) => {
-  return {
-    menuTree: state.menuTree,
-    mainMenu: state.mainMenu,
-    editLevel: state.editLevel
-  }
-}
-
-const mapDispatchToProps = (dispatch) => {
-  return {
-    modifyMenuTree: (menuTree) => dispatch(modifyMenuTree(menuTree)),
-    modifyMainMenu: (mainMenu) => dispatch(modifyMainMenu(mainMenu)),
-    resetEditLevel: (level) => dispatch(resetEditLevel(level)),
-    logout: () => dispatch(logout())
-  }
-}
-
-export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Header))
\ No newline at end of file
+export default withRouter(Header)
\ No newline at end of file

--
Gitblit v1.8.0