From 4eb6fb4b827c8ac5ed45dfe00e87ccbb3d55682e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 11 九月 2024 16:00:49 +0800
Subject: [PATCH] 2024-09-11

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

diff --git a/src/index.js b/src/index.js
index dbc9c37..78cea1c 100644
--- a/src/index.js
+++ b/src/index.js
@@ -37,6 +37,8 @@
       }
     }
 
+    config.keepPwd = config.keepPwd || config.keepPassword
+
     let GLOB = {}
     GLOB.appId = config.appId || ''
     GLOB.lineColor = config.lineColor || ''
@@ -44,13 +46,13 @@
     GLOB.probation = false
     GLOB.watermark = config.watermark + '' !== 'false'
     GLOB.transfer = config.transfer + '' === 'true'
-    GLOB.keepKey = config.keepPassword + '' !== 'false'
-    GLOB.nginx = config.nginx + '' === 'true'
+    GLOB.keepKey = config.keepPwd + '' !== 'false'
+    GLOB.vispwd = config.keepPwd + '' !== 'invisible'
     GLOB.WXAppID = config.WXAppID || ''
     GLOB.WXminiAppID = config.WXminiAppID || ''
+    GLOB.WXMerchID = config.WXMerchID || ''
     GLOB.WXNotice = config.WXNotice + '' === 'true'
     GLOB.execType = config.execType === 'x' ? 'x' : ''
-    GLOB.accessToken = {}
     GLOB.mkHS = false
     GLOB.debugger = false
     GLOB.dataFormat = false
@@ -58,6 +60,13 @@
     GLOB.navBar = 'shutter' // 榛樿涓虹櫨鍙剁獥
     GLOB.style = 'bg_black_style_blue'
     GLOB.defLang = ''
+
+    if (config.WXApps) {
+      config.WXApps = config.WXApps.filter(app => app.appId && app.appName && ['public', 'miniProgram', 'merchant'].includes(app.appType))
+      if (config.WXApps.length) {
+        GLOB.WXApps = config.WXApps
+      }
+    }
 
     if (langs[config.defaultLang]) {
       GLOB.defLang = config.defaultLang
@@ -158,6 +167,11 @@
       }
       if (GLOB.cloudServiceApi) {
         GLOB.mainSystemApi = GLOB.cloudServiceApi
+      }
+
+      if (config.systemRun === 'backend') {
+        config.systemRun = '' // hs 涓嶄娇鐢ㄥ悗绔浛鎹�
+        GLOB.backend = true
       }
     }
 
@@ -336,7 +350,22 @@
       GLOB.memberLevel = 0
     }
 
-    if (GLOB.sysType === 'cloud') {
+    if (config.systemRun === 'backend') {
+      GLOB.debugger = false
+      Object.defineProperty(window, 'backend', {
+        writable: false,
+        value: true
+      })
+    }
+    if (config.debugger === 'forbid') {
+      sessionStorage.removeItem('breakpoint')
+      GLOB.debugger = false
+
+      Object.defineProperty(GLOB, 'debugger', {
+        writable: false,
+        value: GLOB.debugger
+      })
+    } else if (GLOB.sysType === 'cloud') {
       Object.defineProperty(GLOB, 'debugger', {
         writable: false,
         value: GLOB.debugger
@@ -378,7 +407,6 @@
         document.getElementById('root')
       )
     }
-    
   })
 
 serviceWorker.unregister()

--
Gitblit v1.8.0