From c986f2f56bb153a9b6cebc74b4d9334c85ddfdda Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 04 一月 2021 18:54:02 +0800 Subject: [PATCH] 2020-01-04 --- src/index.js | 29 +++++++++++++++++++++++++---- 1 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 7e310fb..7a0c4f7 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,7 @@ import React from 'react' import ReactDOM from 'react-dom' import Route from './router' -import {Provider} from 'react-redux' +import { Provider } from 'react-redux' import store from '@/store' import * as serviceWorker from './serviceWorker' import options from '@/store/options.js' @@ -43,9 +43,19 @@ ) } -sessionStorage.removeItem('isEditState') -// fetch(`./${process.env.NODE_ENV === 'production' ? 'build/' : ''}options.json`) +if (sessionStorage.getItem('loginError')) { + try { + let res = JSON.parse(sessionStorage.getItem('loginError')) + console.info(res.request) + console.info(res.response) + } catch {} +} +sessionStorage.removeItem('isEditState') +sessionStorage.removeItem('loginError') +sessionStorage.setItem('role_id', sessionStorage.getItem('localRole_id') || '') +sessionStorage.setItem('dataM', sessionStorage.getItem('localDataM') || '') + fetch(`./options.json`) .then(response => response.json()) .catch(() => { @@ -58,6 +68,13 @@ 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紡绯荤粺 if (options.sysType === 'local' && (config.systemType === 'official' || config.systemType === 'production')) { @@ -134,6 +151,7 @@ GLOB.doclogo = _systemMsg.doclogo GLOB.webSite = _systemMsg.webSite GLOB.style = _systemMsg.style + GLOB.showline = _systemMsg.showline || '' if (GLOB.favicon) { let link = document.querySelector("link[rel*='icon']") || document.createElement('link') @@ -141,6 +159,9 @@ link.rel = 'shortcut icon' link.href = GLOB.favicon document.getElementsByTagName('head')[0].appendChild(link) + } + if (GLOB.style && options.styles[GLOB.style]) { + document.body.className = options.styles[GLOB.style] + ' ' + (GLOB.showline === 'false' ? 'hidden-split-line' : '') } } catch { console.warn('Parse Failure') @@ -166,7 +187,7 @@ GLOB.service = _service ? _service + '/' : '' } else { GLOB.linkurl = '' - GLOB.location = 'http://qingqiumarket.cn/' + GLOB.location = 'http://qingqiumarket.cn' GLOB.service = 'mkwms/' } -- Gitblit v1.8.0