From 29432c9167e3fcdf83f35d0bb9dbe9acb7c7ffbf Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 22 六月 2021 14:35:23 +0800 Subject: [PATCH] 2021-06-22 --- src/index.js | 31 +++++-------------------------- 1 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/index.js b/src/index.js index 4f87b72..fcc809d 100644 --- a/src/index.js +++ b/src/index.js @@ -57,9 +57,8 @@ sessionStorage.setItem('role_id', sessionStorage.getItem('localRole_id') || '') sessionStorage.setItem('dataM', sessionStorage.getItem('localDataM') || '') -// 娴嬭瘯绯荤粺鏂囦欢缃簬admin涓� +// 鏂扮郴缁熸枃浠剁疆浜巃dmin涓� ../options.json -// fetch(process.env.NODE_ENV === 'production' ? '../options.json' : './options.json') fetch('./options.json') .then(response => response.json()) .catch(() => { @@ -67,17 +66,15 @@ }) .then(config => { if (!config) return - + let GLOB = {} GLOB.appId = config.appId || '' GLOB.lineColor = config.lineColor || '' - GLOB.filter = config.filter || '' if (config.externalDatabase !== false && config.externalDatabase !== 'false' && config.externalDatabase !== undefined) { GLOB.externalDatabase = config.externalDatabase ? `[${config.externalDatabase}]..` : '' } else { GLOB.externalDatabase = null - } // 鍙湁涓氬姟绯荤粺鎵嶅彲浠ヨ缃负姝e紡绯荤粺 @@ -107,24 +104,6 @@ } if (config.mainSystemApi) { let systemApi = config.mainSystemApi - - // if (/^(http|https):\/\//ig.test(systemApi)) { - // let _systemApi = /^(http|https):\/\/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62}|(:[0-9]{1,4}))+\.?/ig.exec(systemApi) - - // systemApi = _systemApi ? _systemApi[0] : '' - // } else { - // systemApi = '' - // } - - // // 涓氬姟绯荤粺杩炴帴浜戠鏃讹紝鏍煎紡鍖栧鐞� - // if (systemApi && systemApi === /^(http|https):\/\/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62}|(:[0-9]{1,4}))+\.?/ig.exec(options.cloudServiceApi)[0]) { - // GLOB.dataFormat = true - // } - - // if (systemApi) { - // systemApi = systemApi + '/webapi/dostars' - // } - // 涓氬姟绯荤粺涓嶅厑璁歌繛鎺ヤ簯绔紝涓氬姟绯荤粺杩炴帴sso.mk9h.cn鏃讹紝鏁版嵁铏氬寲澶勭悊 if (systemApi && systemApi.indexOf('cloud.mk9h.cn') > -1) { systemApi = '' @@ -179,7 +158,7 @@ document.title = GLOB.platTitle || '' - if (GLOB.filter === 'true') { + if (config.filter === 'true') { let html = document.getElementsByTagName('html')[0] if (html) { @@ -196,8 +175,8 @@ GLOB.service = _service ? _service + '/' : '' } else { GLOB.linkurl = '' - GLOB.location = 'http://qingqiumarket.cn' - GLOB.service = 'mkwms/' + GLOB.location = config.host + GLOB.service = config.service } Object.defineProperty(GLOB, 'appId', { -- Gitblit v1.8.0