From fc32b691967b530f949f62cc3758a9d70dbd5a91 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 23 三月 2022 00:14:14 +0800
Subject: [PATCH] 2022-03-23

---
 src/components/header/index.jsx |   56 +++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 43 insertions(+), 13 deletions(-)

diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx
index 3761868..1b78675 100644
--- a/src/components/header/index.jsx
+++ b/src/components/header/index.jsx
@@ -189,10 +189,19 @@
 
         const { menulist, thdMenuList } = this.getMenulist(result)
 
+        let systems = []
+        if ((options.sysType === 'local' || options.sysType === 'SSO') && result.sys_list) {
+          systems = result.sys_list
+
+          if (options.sysType === 'local' && window.GLOB.systemType !== 'production' && systems.length > 10) {
+            systems.length = 10
+          }
+        }
+
         this.setState({
           menulist,
           thdMenuList,
-          systems: window.GLOB.systemType === 'production' || options.sysType === 'SSO' ? (result.sys_list || []) : []
+          systems: systems
         })
         
         let mainMenu = menulist[0] || ''
@@ -446,7 +455,6 @@
             message: result.message,
             duration: 10
           })
-          return
         } else if (result.func_detail && result.func_detail.length > 0) {
           this.writeFuncs(result.func_detail)
         }
@@ -551,18 +559,40 @@
       url = url + '/'
     }
 
-    let href = url + 'index.html#/ssologin/' + window.btoa(window.encodeURIComponent(JSON.stringify({
-      UserID: sessionStorage.getItem('UserID'),
-      LoginUID: sessionStorage.getItem('LoginUID'),
-      User_Name: sessionStorage.getItem('User_Name'),
-      Full_Name: sessionStorage.getItem('Full_Name'),
-      avatar: sessionStorage.getItem('avatar'),
-      dataM: system.dataM ? 'true' : '',
-      debug: system.debug || '',
-      role_id: system.role_id || ''
-    })))
+    let key = Utils.getuuid()
 
-    window.open(href)
+    let _param = {
+      func: 'webapi_scan_binding_key',
+      binding_type: 'mk',
+      scan_type: 'toggle',
+      scan_appkey: system.scan_appkey,
+      id: key
+    }
+
+    Api.getSystemConfig(_param).then(res => {
+      if (!res.status) {
+        notification.warning({
+          top: 92,
+          message: res.message,
+          duration: 5
+        })
+      } else if (res.thd_party_appid && res.thd_party_member_id && res.thd_party_openid) {
+        let href = url + 'admin/index.html#/ssologin/' + window.btoa(window.encodeURIComponent(JSON.stringify({
+          appid: res.thd_party_appid,
+          memberId: res.thd_party_member_id,
+          openid: res.thd_party_openid,
+          key: key
+        })))
+
+        window.open(href)
+      } else {
+        notification.warning({
+          top: 92,
+          message: '淇℃伅缂哄け锛岃鑱旂郴绠$悊鍛橈紒',
+          duration: 5
+        })
+      }
+    })
   }
 
   dropdownMenuChange = (visible) => {

--
Gitblit v1.8.0