| | |
| | | } |
| | | } |
| | | |
| | | if (options.cdomain && options.sysType !== 'cloud') { |
| | | options.cloudServiceApi = options.cdomain + '/webapi/dostars' |
| | | } |
| | | |
| | | let GLOB = {} |
| | | GLOB.appId = config.appId || '' |
| | | GLOB.lineColor = config.lineColor || '' |
| | |
| | | GLOB.WXNotice = config.WXNotice + '' === 'true' |
| | | GLOB.accessToken = {} |
| | | GLOB.mkHS = false |
| | | GLOB.navBar = 'shutter' // 默认为百叶窗 |
| | | |
| | | GLOB.sysType = options.sysType |
| | | if (GLOB.sysType !== 'cloud') { |
| | | GLOB.cloudServiceApi = options.cdomain + '/webapi/dostars' |
| | | } |
| | | |
| | | if (sessionStorage.getItem('externalDatabase')) { |
| | | GLOB.externalDatabase = `[${sessionStorage.getItem('externalDatabase')}]..` |
| | |
| | | } |
| | | |
| | | // 只有业务系统才可以设置为正式系统 |
| | | if (options.sysType === 'local' && (config.systemType === 'official' || config.systemType === 'production')) { |
| | | if (GLOB.sysType === 'local' && (config.systemType === 'official' || config.systemType === 'production')) { |
| | | GLOB.systemType = 'production' |
| | | if (config.probation && /^20\d{2}-\d{2}-\d{2}$/.test(config.probation) && new Date(config.probation).getTime() > new Date().getTime()) { |
| | | GLOB.probation = true |
| | |
| | | document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">正式系统不可使用 http://cloud.mk9h.cn 做为单点地址,请联系管理员!</div>' |
| | | return |
| | | } |
| | | } else if (options.sysType === 'local') { |
| | | } else if (GLOB.sysType === 'local') { |
| | | GLOB.probation = true |
| | | GLOB.systemType = '' |
| | | |
| | |
| | | GLOB.mainSystemApi = '' |
| | | } |
| | | |
| | | GLOB.debugger = options.sysType === 'local' && GLOB.systemType !== 'production' |
| | | GLOB.debugger = GLOB.sysType === 'local' && GLOB.systemType !== 'production' |
| | | |
| | | if (/#\/hs$/.test(window.location.href)) { // hs下不打印脚本 |
| | | GLOB.debugger = false |
| | | } |
| | | |
| | | if (options.sysType !== 'cloud') { |
| | | if (GLOB.sysType !== 'cloud') { |
| | | if (config.appkey === options.cakey) { |
| | | document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">不可使用云端appkey,请联系管理员!</div>' |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (options.sysType === 'cloud') { // cloud不可设置单点服务器地址,云端appkey为系统设置 |
| | | if (GLOB.sysType === 'cloud') { // cloud不可设置单点服务器地址,云端appkey为系统设置 |
| | | GLOB.appkey = options.cakey |
| | | GLOB.appId = options.caId |
| | | GLOB.WXNotice = false |
| | | } else if (options.sysType === 'SSO') { // sso不可设置单点服务器地址 |
| | | } else if (GLOB.sysType === 'SSO') { // sso不可设置单点服务器地址 |
| | | GLOB.appkey = config.appkey |
| | | } else if (options.sysType === 'local') { // 业务系统 |
| | | } else if (GLOB.sysType === 'local') { // 业务系统 |
| | | GLOB.appkey = config.appkey |
| | | if (GLOB.systemType === 'production') { |
| | | let systemApi = config.mainSystemApi |
| | |
| | | |
| | | let _href = window.location.href.split('#')[0] |
| | | let _systemMsg = localStorage.getItem(_href + 'system') |
| | | |
| | | GLOB.navBar = 'shutter' // 默认为百叶窗 |
| | | let className = 'mk-blue-black' |
| | | |
| | | if (_systemMsg) { |
| | |
| | | writable: false, |
| | | value: GLOB.linkurl |
| | | }) |
| | | Object.defineProperty(GLOB, 'sysType', { |
| | | writable: false, |
| | | value: GLOB.sysType |
| | | }) |
| | | Object.defineProperty(GLOB, 'cloudServiceApi', { |
| | | writable: false, |
| | | value: GLOB.cloudServiceApi || '' |
| | | }) |
| | | Object.defineProperty(window, 'GLOB', { |
| | | writable: false, |
| | | value: GLOB |