From c46e208fc65742bf02d43235a28143abbf3eb7ea Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 25 九月 2024 22:23:17 +0800 Subject: [PATCH] 2024-09-25 --- src/index.js | 52 ++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 40 insertions(+), 12 deletions(-) diff --git a/src/index.js b/src/index.js index dbc9c37..89c1f87 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 @@ -159,6 +168,11 @@ if (GLOB.cloudServiceApi) { GLOB.mainSystemApi = GLOB.cloudServiceApi } + + if (config.systemRun === 'backend') { + config.systemRun = '' // hs 涓嶄娇鐢ㄥ悗绔浛鎹� + GLOB.backend = true + } } if (process.env.NODE_ENV === 'production') { // 鐢ㄤ簬鏍¢獙鏄惁瀛樺湪寮�鍙戞潈闄� @@ -174,14 +188,14 @@ GLOB.baseurl = GLOB.location + '/' + GLOB.service GLOB.linkurl = GLOB.baseurl + 'index.html' GLOB.dataFormat = false - - let mark = sessionStorage.getItem('system_mark') - let _mark = `sys_${GLOB.service.replace('/', '') || 'service'}` - if (mark && mark !== _mark) { - sessionStorage.clear() - } - sessionStorage.setItem('system_mark', _mark) } + + let mark = sessionStorage.getItem('system_mark') + let _mark = `sys_${GLOB.service.replace('/', '') || 'service'}` + if (mark && mark !== _mark) { + sessionStorage.clear() + } + sessionStorage.setItem('system_mark', _mark) if (config.mainkey && GLOB.sysType !== 'cloud' && config.mainkey !== options.cakey) { GLOB.localkey = GLOB.appkey @@ -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