| | |
| | | const ScriptForm = asyncComponent(() => import('./scriptform')) |
| | | const SubMutilForm = asyncComponent(() => import('./submutilform')) |
| | | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | const skinStyle = { |
| | | bg_black_style_blue: {name: '蓝色', color: '#1890ff'}, |
| | | bg_black_style_red: {name: '红色', color: '#f5222d'}, |
| | |
| | | forbid = false |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | if (sessionStorage.getItem('devError') === 'true') { |
| | | sessionStorage.clear() |
| | | window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') |
| | | window.location.reload() |
| | | return |
| | | } |
| | | |
| | | if (!sessionStorage.getItem('UserID')) { |
| | | this.props.history.replace('/login') |
| | | return |
| | | } |
| | | |
| | | window.GLOB.developing = true |
| | | |
| | | document.body.className = '' |
| | | this.getAppList() |
| | | this.getSmStemp() |
| | |
| | | let _href = window.location.href.split('#')[0] + 'app_record' |
| | | let record = localStorage.getItem(_href) |
| | | record = record ? JSON.parse(record) : null |
| | | |
| | | if (record) { |
| | | if (record.activeId) { |
| | | let index = applist.findIndex(item => item.ID === record.activeId) |
| | | if (index === -1) { |
| | | localStorage.setItem(_href, JSON.stringify({preId: '', activeId: ''})) |
| | | } else if (index !== 0) { |
| | | applist.unshift(...applist.splice(index, 1)) |
| | | |
| | | if (record && record.dates) { |
| | | let ids = applist.map(item => item.ID) |
| | | let reset = false |
| | | |
| | | Object.keys(record.dates).forEach(key => { |
| | | if (!ids.includes(key)) { |
| | | delete record.dates[key] |
| | | reset = true |
| | | } |
| | | }) |
| | | |
| | | applist.sort((a, b) => { |
| | | return (record.dates[b.ID] || 0) - (record.dates[a.ID] || 0) |
| | | }) |
| | | |
| | | if (reset) { |
| | | localStorage.setItem(_href, JSON.stringify(record)) |
| | | } |
| | | } |
| | | } |
| | |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | let msgs = [] |
| | | if (!res.status) { |
| | | notification.warning({ |
| | |
| | | let record = localStorage.getItem(_href) |
| | | record = record ? JSON.parse(record) : null |
| | | |
| | | if (!record) { |
| | | localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: ''})) |
| | | if (!record || !record.dates) { |
| | | localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID, dates: {[selectApp.ID]: new Date().getTime()}})) |
| | | } else { |
| | | if (record.preId === selectApp.ID) { |
| | | localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID})) |
| | | if (record.preId === selectApp.ID || record.activeId === selectApp.ID) { |
| | | localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID, dates: {...record.dates, [selectApp.ID]: new Date().getTime()}})) |
| | | } else { |
| | | localStorage.setItem(_href, JSON.stringify({...record, preId: selectApp.ID})) |
| | | } |