src/index.js
@@ -83,44 +83,52 @@ if (config.probation && /^20\d{2}-\d{2}-\d{2}$/.test(config.probation) && new Date(config.probation).getTime() > new Date().getTime()) { GLOB.probation = true } if (!config.mainSystemApi) { document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">系统未设置单点地址,请联系管理员!</div>' return } else if (/http(s?):\/\/sso.mk9h.cn\/cloud/ig.test(config.mainSystemApi)) { document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">正式系统不可使用 http://sso.mk9h.cn/cloud 做为单点地址,请联系管理员!</div>' return } else if (/http(s?):\/\/cloud.mk9h.cn/ig.test(config.mainSystemApi)) { 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') { GLOB.probation = true GLOB.systemType = '' // GLOB.mainSystemApi = 'https://cloud.positecgroup.com/webapi/dostars' GLOB.mainSystemApi = 'http://sso.mk9h.cn/cloud/webapi/dostars' if (GLOB.watermark) { GLOB.dataFormat = true } } else { GLOB.systemType = '' GLOB.mainSystemApi = '' } if (options.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为系统设置 GLOB.appkey = options.cakey GLOB.mainSystemApi = '' } else if (options.sysType === 'SSO') { // sso不可设置单点服务器地址 GLOB.mainSystemApi = '' if (config.appkey === options.cakey) { GLOB.appkey = '' console.warn('单点系统appkey不可与云端相同') } else { GLOB.appkey = config.appkey } } else if (options.sysType === 'local') { // 业务系统 if (config.appkey === options.cakey) { GLOB.appkey = '' console.warn('业务系统appkey不可与云端相同') } else { GLOB.appkey = config.appkey } if (config.mainSystemApi) { if (GLOB.systemType === 'production') { let systemApi = config.mainSystemApi // 业务系统不允许连接云端,业务系统连接sso.mk9h.cn时,数据虚化处理 if (systemApi.indexOf('cloud.mk9h.cn') > -1) { systemApi = '' } else if (/index.html/ig.test(systemApi)) { if (/index.html/ig.test(systemApi)) { systemApi = systemApi.replace(/index.html.*/ig, 'webapi/dostars') } else if (!/webapi\/dostars$/ig.test(systemApi)) { systemApi = systemApi.replace(/\/?$/, '/webapi/dostars') } if (systemApi.indexOf('sso.mk9h.cn') > -1 && GLOB.watermark) { GLOB.dataFormat = true } GLOB.mainSystemApi = systemApi src/menu/components/card/cardcellcomponent/dragaction/index.jsx
@@ -58,6 +58,13 @@ copycard.originCard = card try { delete _val.$srcId let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { _val.$srcId = srcid } _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { console.warn('Stringify Failure') src/menu/components/search/main-search/dragsearch/index.jsx
@@ -50,6 +50,13 @@ let _val = fromJS(copycard).toJS() try { delete _val.$srcId let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { _val.$srcId = srcid } _val.uuid = Utils.getuuid() _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { src/menu/components/share/actioncomponent/dragaction/index.jsx
@@ -74,6 +74,13 @@ copycard.originCard = card try { delete _val.$srcId let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { _val.$srcId = srcid } _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { console.warn('Stringify Failure') src/menu/components/share/copycomponent/index.jsx
@@ -13,13 +13,18 @@ trigger = () => { const { card, type } = this.props let copycard = fromJS(card).toJS() copycard.copyType = type let _val = '' let _val = fromJS(card).toJS() _val.copyType = type try { _val = window.btoa(window.encodeURIComponent(JSON.stringify(copycard))) delete _val.$srcId let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { _val.$srcId = srcid } _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { message.warning('复制失败,请重试!') _val = '' src/menu/components/share/searchcomponent/dragsearch/index.jsx
@@ -44,6 +44,13 @@ let _val = fromJS(copycard).toJS() try { delete _val.$srcId let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { _val.$srcId = srcid } _val.uuid = Utils.getuuid() _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { src/menu/components/table/edit-table/columns/index.jsx
@@ -405,6 +405,11 @@ cols: columns.filter(col => !col.origin) } let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { val.$srcId = srcid } oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) oInput.select() src/menu/components/table/normal-table/columns/index.jsx
@@ -442,6 +442,11 @@ cols: columns.filter(col => !col.origin) } let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { val.$srcId = srcid } oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) oInput.select() src/menu/sysinterface/index.jsx
@@ -74,6 +74,11 @@ copy = (item) => { let msg = { key: 'interface', type: 'line', data: item } let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { msg.$srcId = srcid } try { msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) } catch (e) { src/mob/components/formdragelement/index.jsx
@@ -54,6 +54,13 @@ let val = JSON.parse(JSON.stringify(_card)) val.copyType = 'form' delete val.$srcId let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { val.$srcId = srcid } oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) oInput.select() src/mob/searchconfig/searchdragelement/index.jsx
@@ -53,6 +53,13 @@ let val = JSON.parse(JSON.stringify(_card)) val.copyType = 'search' delete val.$srcId let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { val.$srcId = srcid } oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) oInput.select() src/templates/formtabconfig/dragelement/index.jsx
@@ -59,6 +59,13 @@ delete val.originUuid delete val.iscopy delete val.$srcId let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { val.$srcId = srcid } oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) oInput.select() src/templates/modalconfig/dragelement/index.jsx
@@ -54,6 +54,13 @@ let val = JSON.parse(JSON.stringify(_card)) val.copyType = 'form' delete val.$srcId let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { val.$srcId = srcid } oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) oInput.select() src/templates/sharecomponent/actioncomponent/dragaction/index.jsx
@@ -64,6 +64,13 @@ let _val = fromJS(copycard).toJS() try { delete _val.$srcId let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { _val.$srcId = srcid } _val.uuid = Utils.getuuid() _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { src/templates/sharecomponent/columncomponent/index.jsx
@@ -377,6 +377,11 @@ columns: columnlist } let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { val.$srcId = srcid } oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) oInput.select() src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx
@@ -50,6 +50,13 @@ let _val = fromJS(copycard).toJS() try { delete _val.$srcId let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { _val.$srcId = srcid } _val.uuid = Utils.getuuid() _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { src/templates/zshare/editTable/index.jsx
@@ -331,6 +331,11 @@ } try { let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid) { msg.$srcId = srcid } msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) } catch (e) { console.warn('Stringify Failure') src/templates/zshare/pasteform/index.jsx
@@ -27,9 +27,23 @@ this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { let _config = values.config try { _config = JSON.parse(window.decodeURIComponent(window.atob(_config))) if (typeof(_config) === 'object' && _config.$srcId) { let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') if (srcid && _config.$srcId !== srcid) { notification.warning({ top: 92, message: '当前系统无权限使用此项配置!', duration: 5 }) _config = '' } else { delete _config.$srcId } } } catch (e) { notification.warning({ top: 92, @@ -47,14 +61,6 @@ } }) }) } submit = () => { if (this.props.inputSubmit) { setTimeout(() => { this.props.inputSubmit() }, 10) } } render() { @@ -82,7 +88,7 @@ message: '请输入配置信息!' } ] })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }} onPressEnter={this.submit}/>)} })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }}/>)} </Form.Item> </Col> </Row> src/views/login/index.jsx
@@ -100,21 +100,19 @@ sessionStorage.setItem('organization', res.organization || '') sessionStorage.setItem('localRole_id', res.role_id || '') let _url = window.location.href.split('#')[0] localStorage.setItem(_url + 'lang', param.lang || 'zh-CN') localStorage.setItem(_href + 'lang', param.lang || 'zh-CN') sessionStorage.setItem('lang', param.lang || 'zh-CN') sessionStorage.removeItem('visitorUserID') sessionStorage.removeItem('visitorLoginUID') if (param.remember) { // 记住密码时账号密码存入localStorage localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify({username: param.username, password: param.password})))) localStorage.setItem(_href, window.btoa(window.encodeURIComponent(JSON.stringify({username: param.username, password: param.password})))) } else { localStorage.removeItem(_url) localStorage.removeItem(_href) } let level = localStorage.getItem(_url + 'pwdlevel') let level = localStorage.getItem(_href + 'pwdlevel') if (level) { let visible = false @@ -204,9 +202,7 @@ sessionStorage.setItem('organization', res.organization || '') sessionStorage.setItem('localRole_id', res.role_id || '') let _url = window.location.href.split('#')[0] localStorage.setItem(_url + 'lang', param.lang || 'zh-CN') localStorage.setItem(_href + 'lang', param.lang || 'zh-CN') sessionStorage.setItem('lang', param.lang || 'zh-CN') sessionStorage.removeItem('visitorUserID') @@ -333,7 +329,7 @@ }, 1500) } const _addressUrl = window.location.href.split('#')[0] + 'queryAddress' const _addressUrl = _href + 'queryAddress' if (localStorage.getItem(_addressUrl) !== 'true') { sessionStorage.setItem('city', '') @@ -343,7 +339,7 @@ } const timeStamp = new Date().getTime() const _authUrl = window.location.href.split('#')[0] + 'AuthCode' const _authUrl = _href + 'AuthCode' let authCode = localStorage.getItem(_authUrl) let _s = md5('mksoft' + moment().format('YYYYMMDD')) @@ -389,7 +385,7 @@ lictime = Math.floor(new Date(lictime).getTime() / 86400000) let curtime = Math.floor(new Date().getTime() / 86400000) let licday = lictime - curtime let _mindUrl = window.location.href.split('#')[0] + 'notMind' let _mindUrl = _href + 'notMind' if (licday < 0 || isNaN(licday)) { Modal.warning({ @@ -549,7 +545,7 @@ res.titlelogo = res.titlelogo ? res.titlelogo.replace(/^http:/ig, 'https:') : '' } let _url = window.location.href.split('#')[0] + 'system' let _url = _href + 'system' let systemMsg = { favicon: res.titlelogo || '', platTitle: res.titleName || '', @@ -573,7 +569,13 @@ level = '' } localStorage.setItem(window.location.href.split('#')[0] + 'pwdlevel', level) localStorage.setItem(_href + 'pwdlevel', level) if (res.srcid) { localStorage.setItem(_href + 'srcId', res.srcid) } else { localStorage.removeItem(_href + 'srcId') } sessionStorage.setItem('home_background', res.index_background_color || '') if (res.sys_datetime) { @@ -590,7 +592,7 @@ localStorage.removeItem(_url) } let _loginurl = window.location.href.split('#')[0] + 'loginways' let _loginurl = _href + 'loginways' let login_ways = [] let login_types = [] if (res.login_ways && res.login_ways.length > 0) { @@ -684,7 +686,7 @@ } }) let loginWays = localStorage.getItem(window.location.href.split('#')[0] + 'loginways') let loginWays = localStorage.getItem(_href + 'loginways') if (loginWays) { try { loginWays = JSON.parse(window.decodeURIComponent(window.atob(loginWays)))