From a45ebcabfb93f05d8c0550edb9659b50c227c5cc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 15 四月 2020 09:44:31 +0800
Subject: [PATCH] 2020-04-15

---
 src/tabviews/managetable/secretKeyTable/index.jsx |   40 ++++++++++++++++++++++++----------------
 1 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/src/tabviews/managetable/secretKeyTable/index.jsx b/src/tabviews/managetable/secretKeyTable/index.jsx
index 7141cc7..2e5b17e 100644
--- a/src/tabviews/managetable/secretKeyTable/index.jsx
+++ b/src/tabviews/managetable/secretKeyTable/index.jsx
@@ -7,7 +7,7 @@
 import zhCN from '@/locales/zh-CN/main.js'
 import enUS from '@/locales/en-US/main.js'
 import options from '@/store/options.js'
-import { buttonConfig, tabConfig } from './config'
+import { buttonConfig, tabConfig, refCodes } from './config'
 
 import SubTable from '@/tabviews/zshare/normalTable'
 import SubAction from './actionList'
@@ -150,32 +150,40 @@
     let result = await Api.getLocalConfig(param)
 
     if (result.status) {
-      // let _data = result.secret_param
+      let str = result.secret_param
 
-      let _data = [
-        {uuid: 'sso_system', public: 'a', private: 'apple', keyType: 'sso'},
-        {uuid: 'local_system', public: 'b', private: 'banana', keyType: 'local'},
-        {uuid: 'other_system1', public: 'c', private: 'cherry', keyType: 'other'},
-        {uuid: 'other_system2', public: 'd', private: 'damson', keyType: 'other'}
-      ]
-      _data = _data.map((item, index) => {
-        item.key = index
-        return item
-      })
-      // Math.floor(Math.random()*10)
       try {
-
+        if (str) {
+          str = str.substring(1)
+          str = window.atob(str)
+          refCodes.forEach(item => {
+            str = str.replace(new RegExp(item.md5str, 'g'), item.char)
+          })
+          str = JSON.parse(window.decodeURIComponent(window.atob(str)))
+        }
       } catch {
+        str = ''
+      }
+
+      if (!str) {
         this.setState({
-          loading: false
+          loading: false,
+          pickup: false,
+          data: []
         })
         notification.error({
           top: 92,
-          message: '瀵嗛挜缁勬暟鎹牸寮忛敊璇紝璇锋仮澶嶉粯璁よ缃悗锛岄噸鏂版坊鍔狅紒',
+          message: '瀵嗛挜缁勬暟鎹涪澶辨垨鏍煎紡閿欒锛岃鎭㈠榛樿璁剧疆锛岄噸鏂版坊鍔狅紒',
           duration: 15
         })
         return
       }
+
+      let _data = str.map((item, index) => {
+        item.key = index
+        return item
+      })
+
       this.setState({
         data: _data,
         pickup: false,

--
Gitblit v1.8.0