From 31aa3ba8a4b028d04c43b5960e23820abffd1ad1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 27 五月 2024 14:23:09 +0800
Subject: [PATCH] 2024-05-27

---
 src/index.js |   44 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/src/index.js b/src/index.js
index 246d3bb..2fbab2f 100644
--- a/src/index.js
+++ b/src/index.js
@@ -53,6 +53,7 @@
     GLOB.WXAppID = config.WXAppID || ''
     GLOB.WXminiAppID = config.WXminiAppID || ''
     GLOB.WXNotice = config.WXNotice + '' === 'true'
+    GLOB.execType = config.execType === 'x' ? 'x' : ''
     GLOB.accessToken = {}
     GLOB.mkHS = false
     GLOB.debugger = false
@@ -74,6 +75,13 @@
       GLOB.externalDatabase = null
     }
 
+    if (config.probation && /^20\d{2}-\d{2}-\d{2}$/.test(config.probation) && new Date(config.probation).getTime() > new Date().getTime()) {
+      GLOB.probation = true
+    }
+    if (config.forcedUpdate && /^20\d{2}-\d{2}-\d{2}$/.test(config.forcedUpdate) && new Date(config.forcedUpdate).getTime() > new Date().getTime()) {
+      GLOB.forcedUpdate = true
+    }
+
     // 鍙湁涓氬姟绯荤粺鎵嶅彲浠ヨ缃负姝e紡绯荤粺
     if (GLOB.sysType === 'local' && (config.systemType === 'official' || config.systemType === 'production')) {
       if (!config.mainSystemApi) {
@@ -88,12 +96,6 @@
       }
 
       GLOB.systemType = 'production'
-      if (config.probation && /^20\d{2}-\d{2}-\d{2}$/.test(config.probation) && new Date(config.probation).getTime() > new Date().getTime()) {
-        GLOB.probation = true
-      }
-      if (config.forcedUpdate && /^20\d{2}-\d{2}-\d{2}$/.test(config.forcedUpdate) && new Date(config.forcedUpdate).getTime() > new Date().getTime()) {
-        GLOB.forcedUpdate = true
-      }
     } else if (GLOB.sysType === 'local') {
       GLOB.probation = true
       GLOB.debugger = true
@@ -244,9 +246,39 @@
       sessionStorage.setItem('system_mark', _mark)
     }
 
+    if (config.mainkey && GLOB.sysType !== 'cloud' && config.mainkey !== options.cakey) {
+      GLOB.localkey = GLOB.appkey
+      GLOB.appkey = config.mainkey
+    }
+
     let lang = localStorage.getItem(_href + 'lang') || (config.defaultLang !== 'en-US' ? 'zh-CN' : 'en-US')
     sessionStorage.setItem('lang', lang)
 
+    if (localStorage.getItem(_href + 'files') === md5(_href + 'files')) {
+      let d = localStorage.getItem(_href + 'filesDate')
+
+      GLOB.storeFiles = true
+      GLOB.storeDate = Math.ceil((new Date(d).getTime() - new Date().getTime()) / 86400000)
+    } else if (GLOB.licenseKey && config.storeKey && config.storeKey.length === 16) {
+      let trans = {A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9}
+      let d = config.storeKey.slice(0, 8)
+
+      d = d.split('').map(k => trans[k]).join('')
+
+      let key = config.storeKey.slice(8)
+      let _key = GLOB.appId + GLOB.appkey + 'e_files_key' + d
+      _key = md5(_key.toLowerCase())
+      _key = _key.toUpperCase()
+      _key = _key.slice(-8)
+
+      if (key === _key) {
+        GLOB.storeFiles = true
+        
+        d = d.slice(0, 4) + '-' + d.slice(4, 6) + '-' + d.slice(6)
+        GLOB.storeDate = Math.ceil((new Date(d).getTime() - new Date().getTime()) / 86400000)
+      }
+    }
+
     GLOB.mkActions = {}  // 鎸夐挳鏉冮檺闆�
 
     Object.defineProperty(GLOB, 'appId', {

--
Gitblit v1.8.0