From 32973f90869ff466401759c23681fc06fa65c71a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 10 六月 2025 23:06:50 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/index.js | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/index.js b/src/index.js index 0c670ea..a1b3e25 100644 --- a/src/index.js +++ b/src/index.js @@ -95,10 +95,10 @@ GLOB.externalDatabase = null } - if (config.probation && /^20\d{2}-\d{2}-\d{2}$/.test(config.probation) && new Date(config.probation).getTime() > new Date().getTime()) { + if (config.probation && /^[1-9]\d{3}-\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()) { + if (config.forcedUpdate && /^[1-9]\d{3}-\d{2}-\d{2}$/.test(config.forcedUpdate) && new Date(config.forcedUpdate).getTime() > new Date().getTime()) { GLOB.forcedUpdate = true } @@ -118,20 +118,20 @@ GLOB.systemType = 'production' } else if (GLOB.sysType === 'local') { GLOB.probation = true - GLOB.debugger = true + // GLOB.debugger = true GLOB.systemType = '' GLOB.upStatus = config.updateStatus + '' !== 'false' + + GLOB.mainSystemApi = 'https://cloud.positecgroup.com/webapi/dostars' if (config.style_appkey) { GLOB.style_appkey = config.style_appkey } - - // GLOB.mainSystemApi = 'https://cloud.positecgroup.com/webapi/dostars' - - GLOB.mainSystemApi = 'https://sso.mk9h.cn/cloud/webapi/dostars' - if (!/^https/.test(window.location.protocol)) { // https杞崲 - GLOB.mainSystemApi = 'http://sso.mk9h.cn/cloud/webapi/dostars' - } + + // GLOB.mainSystemApi = 'https://sso.mk9h.cn/cloud/webapi/dostars' + // if (!/^https/.test(window.location.protocol)) { // https杞崲 + // GLOB.mainSystemApi = 'http://sso.mk9h.cn/cloud/webapi/dostars' + // } if (GLOB.watermark) { GLOB.dataFormat = true @@ -221,7 +221,7 @@ GLOB.appkey = config.mainkey } - let lang = localStorage.getItem(window.location.href.split('#')[0] + 'lang') || GLOB.defLang || 'zh-CN' + let lang = sessionStorage.getItem('lang') || localStorage.getItem(window.location.href.split('#')[0] + 'lang') || GLOB.defLang || 'zh-CN' sessionStorage.setItem('lang', lang) GLOB.sysSign = GLOB.service + 'admin/' + lang + '/' @@ -280,7 +280,7 @@ document.body.className = className - if (/^https/.test(window.location.protocol)) { // https杞崲 + if (/^https/.test(window.location.protocol) || (process.env.NODE_ENV !== 'production' && /^https/.test(config.host))) { // https杞崲 let meta = document.createElement('meta') meta.content = 'upgrade-insecure-requests' meta.httpEquiv = 'Content-Security-Policy' @@ -289,7 +289,7 @@ document.title = GLOB.platTitle || '' - if (config.filter === 'true' || (/^20\d{2}-\d{2}-\d{2}$/.test(config.filter) && new Date(config.filter).getTime() + 86400000 >= new Date().getTime())) { + if (config.filter === 'true' || (/^[1-9]\d{3}-\d{2}-\d{2}$/.test(config.filter) && new Date(config.filter).getTime() + 86400000 >= new Date().getTime())) { GLOB.filter = true } -- Gitblit v1.8.0