| | |
| | | import '@/assets/css/viewstyle.scss' |
| | | |
| | | if (!localStorage.getItem('SessionUid')) { |
| | | localStorage.setItem('SessionUid', (() => { |
| | | let sid = (() => { |
| | | let uuid = [] |
| | | let _options = '0123456789abcdefghigklmnopqrstuv' |
| | | for (let i = 0; i < 32; i++) { |
| | | uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1)) |
| | | } |
| | | return uuid.join('') |
| | | })()) |
| | | })() |
| | | |
| | | if (/_mk_sid=[0-9a-z]{32}/.test(document.cookie)) { |
| | | sid = document.cookie.match(/_mk_sid=[0-9a-z]{32}/)[0].split('=')[1] |
| | | } else { |
| | | document.cookie = '_mk_sid=' + sid |
| | | } |
| | | |
| | | localStorage.setItem('SessionUid', sid) |
| | | |
| | | } |
| | | |
| | | sessionStorage.setItem('UserID', localStorage.getItem('UserID') || '') |
| | |
| | | GLOB.WXminiAppID = config.WXminiAppID || '' |
| | | GLOB.WXMerchID = config.WXMerchID || '' |
| | | GLOB.WXNotice = config.WXNotice + '' === 'true' |
| | | GLOB.SysNotice = config.SysNotice + '' === 'true' |
| | | GLOB.execType = config.execType === 'x' ? 'x' : '' |
| | | GLOB.mkHS = false |
| | | GLOB.debugger = false |
| | |
| | | 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://sso.mk9h.cn/cloud/webapi/dostars' |
| | | // if (!/^https/.test(window.location.protocol)) { // https转换 |
| | | // GLOB.mainSystemApi = 'http://sso.mk9h.cn/cloud/webapi/dostars' |
| | |
| | | |
| | | GLOB.mainSystemApi = systemApi |
| | | } |
| | | |
| | | if (config.errorLog === 'true' && /#\/(login|main|billprint|docprint|tab|iframe|view|ssologin)/.test(window.location.href)) { |
| | | GLOB.errorLog = true |
| | | } |
| | | } |
| | | |
| | | if (/#\/hs$/.test(window.location.href)) { // hs下不打印脚本 |
| | |
| | | GLOB.host = window.location.host + (_service ? '_' + _service : '') |
| | | GLOB.baseurl = document.location.origin + '/' + GLOB.service |
| | | GLOB.linkurl = GLOB.baseurl + 'index.html' |
| | | GLOB.location = document.location.origin |
| | | } else { |
| | | GLOB.location = config.host |
| | | GLOB.service = config.service |
| | |
| | | } |
| | | |
| | | if (config.systemRun === 'backend') { |
| | | GLOB.debugger = false |
| | | Object.defineProperty(window, 'backend', { |
| | | writable: false, |
| | | value: true |
| | | }) |
| | | if (sessionStorage.getItem('systemRun') === 'front') { |
| | | GLOB.debugger = true |
| | | } else { |
| | | GLOB.debugger = false |
| | | Object.defineProperty(window, 'backend', { |
| | | writable: false, |
| | | value: true |
| | | }) |
| | | } |
| | | } |
| | | if (config.debugger === 'forbid') { |
| | | sessionStorage.removeItem('breakpoint') |