| | |
| | | window.GLOB.$error = false |
| | | |
| | | let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : '' |
| | | let db = `mkdb${service}` |
| | | let lang = sessionStorage.getItem('lang') !== 'zh-CN' ? sessionStorage.getItem('lang') : '' |
| | | let db = `mkdb${service + lang}` |
| | | |
| | | if (window.indexedDB) { |
| | | CacheUtils.openIndexDB(db) |
| | |
| | | UNSAFE_componentWillMount () { |
| | | let home = { |
| | | MenuID: 'home_page_id', |
| | | MenuName: '首页', |
| | | MenuName: window.GLOB.dict['home'] || '首页', |
| | | type: 'Home' |
| | | } |
| | | this.setState({tabview: home}) |
| | |
| | | gotoHome = () => { |
| | | let home = { |
| | | MenuID: 'home_page_id', |
| | | MenuName: '首页', |
| | | MenuName: window.GLOB.dict['home'] || '首页', |
| | | type: 'Home' |
| | | } |
| | | this.setState({tabview: home}) |
| | |
| | | thdMenuList: [], |
| | | debug: sessionStorage.getItem('debug') === 'true' && window.GLOB.memberLevel > 0, |
| | | collapse: sessionStorage.getItem('collapse') === 'true', |
| | | lang: sessionStorage.getItem('lang') || '' |
| | | lang: sessionStorage.getItem('lang') || '', |
| | | dict: window.GLOB.dict |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | } |
| | | |
| | | logout = () => { |
| | | const { dict } = this.state |
| | | // 退出登录 |
| | | let _this = this |
| | | confirm({ |
| | | title: '您确定要退出吗?', |
| | | title: dict['logout_query'] || '您确定要退出吗?', |
| | | content: '', |
| | | okText: '确定', |
| | | cancelText: '取消', |
| | | okText: dict['ok'] || '确定', |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | sessionStorage.clear() |
| | | _this.props.history.replace('/login') |
| | |
| | | |
| | | sessionStorage.setItem('CloudLogo', res.open_logo || '') |
| | | |
| | | let _url = window.location.href.split('#')[0] + 'cloud' |
| | | if (param.remember) { |
| | | localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: param.password})))) |
| | | localStorage.setItem(window.GLOB.sysSign + 'cloud', window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: param.password})))) |
| | | } else { |
| | | localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: ''})))) |
| | | localStorage.setItem(window.GLOB.sysSign + 'cloud', window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: ''})))) |
| | | } |
| | | |
| | | window.GLOB.mainMenu = null |
| | |
| | | } |
| | | |
| | | verup = () => { |
| | | const { dict } = this.state |
| | | |
| | | confirm({ |
| | | title: '页面更新', |
| | | content: '重新加载应用信息', |
| | | title: dict['page_upd'] || '页面更新', |
| | | content: dict['reload_app'] || '重新加载应用信息', |
| | | okText: dict['ok'] || '确定', |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | if (!window.GLOB.IndexDB) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '更新失败,请刷新页面重试!', |
| | | message: dict['exc_fail'] || '更新失败,请刷新页面重试!', |
| | | duration: 2 |
| | | }) |
| | | resolve() |
| | |
| | | setTimeout(() => { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '更新成功!', |
| | | message: dict['exc_success'] || '更新成功!', |
| | | duration: 2 |
| | | }) |
| | | resolve() |
| | |
| | | |
| | | about = () => { |
| | | Modal.success({ |
| | | title: '系统版本v' + window.GLOB.appVersion |
| | | title: (window.GLOB.dict['sys_ver'] || '系统版本') + ' v' + window.GLOB.appVersion, |
| | | okText: window.GLOB.dict['got_it'] || '知道了', |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { thdMenuList, searchkey, debug, menulist, collapse } = this.state |
| | | const { thdMenuList, searchkey, debug, menulist, collapse, dict } = this.state |
| | | const navBar = window.GLOB.navBar |
| | | |
| | | const menu = ( |
| | | <Menu className="header-dropdown"> |
| | | {debug && <Menu.Item key="switch"> |
| | | 编辑 |
| | | {dict['edit'] || '编辑'} |
| | | <Switch size="small" style={{marginLeft: '7px'}} checked={false} onChange={this.changeEditState} /> |
| | | </Menu.Item>} |
| | | <Menu.Item key="password" onClick={this.changePassword}>修改密码</Menu.Item> |
| | | {this.state.systems.length ? <Menu.SubMenu style={{minWidth: '110px'}} title="切换系统"> |
| | | <Menu.Item key="password" onClick={this.changePassword}>{dict['ch_pwd'] || '修改密码'}</Menu.Item> |
| | | {this.state.systems.length ? <Menu.SubMenu style={{minWidth: '110px'}} title={dict['swt_sys'] || '切换系统'}> |
| | | {this.state.systems.map((system, index) => ( |
| | | <Menu.Item style={{minWidth: '100px', lineHeight: '30px'}} key={'sub' + index} onClick={() => {this.changeSystem(system)}}> {system.AppName} </Menu.Item> |
| | | ))} |
| | | </Menu.SubMenu> : null} |
| | | <Menu.Item key="doc" onClick={this.gotoDoc}>文档中心</Menu.Item> |
| | | <Menu.Item key="doc" onClick={this.gotoDoc}>{dict['doc_center'] || '文档中心'}</Menu.Item> |
| | | <Menu.Item key="verup" onClick={this.verup}> |
| | | 页面更新 |
| | | {dict['page_upd'] || '页面更新'} |
| | | </Menu.Item> |
| | | {window.GLOB.WXNotice ? <Menu.Item key="wxnotice" onClick={() => this.setState({wxVisible: true})}> |
| | | 微信消息 |
| | | </Menu.Item> : null} |
| | | {window.GLOB.appVersion ? <Menu.Item key="version" onClick={this.about}> |
| | | 关于 |
| | | {dict['about'] || '关于'} |
| | | </Menu.Item> : null} |
| | | <Menu.Item key="logout" onClick={this.logout}>退出</Menu.Item> |
| | | <Menu.Item key="logout" onClick={this.logout}>{dict['logout'] || '退出'}</Menu.Item> |
| | | </Menu> |
| | | ) |
| | | |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let _url = window.location.href.split('#')[0] + 'cloud' |
| | | let _user = localStorage.getItem(_url) |
| | | let _user = localStorage.getItem(window.GLOB.sysSign + 'cloud') |
| | | |
| | | if (_user) { |
| | | try { |
| | |
| | | |
| | | if (_user && new Date().getTime() - _user.time > 1000 * 7 * 24 * 60 * 60) { |
| | | _user = '' |
| | | localStorage.removeItem(_url) |
| | | localStorage.removeItem(window.GLOB.sysSign + 'cloud') |
| | | } |
| | | |
| | | if (_user) { |
| | |
| | | |
| | | rememberChange = (e) => { |
| | | let val = e.target.checked |
| | | let _url = window.location.href.split('#')[0] + 'cloud' |
| | | |
| | | if (!val) { |
| | | localStorage.removeItem(_url) |
| | | localStorage.removeItem(window.GLOB.sysSign + 'cloud') |
| | | } |
| | | } |
| | | |
| | |
| | | _config = JSON.parse(window.decodeURIComponent(window.atob(_config))) |
| | | |
| | | if (typeof(_config) === 'object' && _config.$srcId) { |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid && _config.$srcId !== srcid) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | visible: false, |
| | | loading: false, |
| | | type: 'account', |
| | | okText: '确定', |
| | | okText: window.GLOB.dict['ok'] || '确定', |
| | | dict: window.GLOB.dict, |
| | | smsId: '', |
| | | mob: '', |
| | | code: '' |
| | |
| | | visible: true, |
| | | loading: false, |
| | | type: 'account', |
| | | okText: '确定', |
| | | okText: window.GLOB.dict['ok'] || '确定', |
| | | mob: '', |
| | | code: '', |
| | | smsId: sessionStorage.getItem('mk_sms_id') || '' |
| | |
| | | } |
| | | |
| | | resetPwdSubmit = () => { |
| | | const { type } = this.state |
| | | const { type, dict } = this.state |
| | | |
| | | if (type === 'account') { |
| | | this.formRef.handleConfirm().then(res => { |
| | |
| | | }) |
| | | notification.success({ |
| | | top: 92, |
| | | message: '修改成功,请重新登录。', |
| | | message: dict['re_login'] || '修改成功,请重新登录。', |
| | | duration: 2 |
| | | }) |
| | | this.callback && this.callback() |
| | |
| | | if (!/^1[3456789]\d{9}$/.test(res.phone)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '手机号格式错误,请重填!', |
| | | message: dict['phone_error'] || '手机号格式错误,请重填!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | this.setState({ |
| | | code: res.vercode, |
| | | type: 'phonepwd', |
| | | okText: '确定' |
| | | okText: dict['ok'] || '确定' |
| | | }) |
| | | }, () => {}) |
| | | } else if (type === 'phonepwd') { |
| | |
| | | }) |
| | | notification.success({ |
| | | top: 92, |
| | | message: '修改成功,请重新登录。', |
| | | message: dict['re_login'] || '修改成功,请重新登录。', |
| | | duration: 2 |
| | | }) |
| | | this.callback && this.callback() |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { visible, loading, okText, type, mob, smsId } = this.state |
| | | const { visible, loading, okText, type, mob, smsId, dict } = this.state |
| | | |
| | | return ( |
| | | <Modal |
| | | title="修改密码" |
| | | title={dict['ch_pwd'] || '修改密码'} |
| | | wrapClassName="reset-password-modal" |
| | | visible={visible} |
| | | maskClosable={false} |
| | | onOk={this.resetPwdSubmit} |
| | | onCancel={() => { this.setState({ visible: false })}} |
| | | okText={okText} |
| | | cancelText="取消" |
| | | cancelText={dict['cancel'] || '取消'} |
| | | confirmLoading={loading} |
| | | destroyOnClose |
| | | > |
| | | <Resetpwd type={type} mob={mob} smsId={smsId} wrappedComponentRef={(inst) => this.formRef = inst} resetPwdSubmit={this.resetPwdSubmit}/> |
| | | {type === 'account' && smsId ? <div className="forget-pwd"><span onClick={() => this.setState({type: 'mob', okText: '下一步'})}>忘记密码?</span></div> : null} |
| | | {type === 'account' && smsId ? <div className="forget-pwd"><span onClick={() => this.setState({type: 'mob', okText: dict['next'] || '下一步'})}>{dict['forgot_pwd'] || '忘记密码?'}</span></div> : null} |
| | | </Modal> |
| | | ) |
| | | } |
| | |
| | | state = { |
| | | confirmDirty: false, |
| | | autoCompleteResult: [], |
| | | level: localStorage.getItem(window.location.href.split('#')[0] + 'pwdlevel') || '' |
| | | level: localStorage.getItem(window.GLOB.sysSign + 'pwdlevel') || '', |
| | | dict: window.GLOB.dict, |
| | | } |
| | | |
| | | LoginTimer = null |
| | |
| | | compareToFirstPassword = (rule, value, callback) => { |
| | | const { form } = this.props |
| | | if (value && value !== form.getFieldValue('password')) { |
| | | callback('两次输入密码不一致!') |
| | | callback(window.GLOB.dict['pwd_notM'] || '两次输入密码不一致!') |
| | | } else { |
| | | callback() |
| | | } |
| | |
| | | |
| | | validateToNextPassword = (rule, value, callback) => { |
| | | const { form } = this.props |
| | | const { level } = this.state |
| | | const { level, dict } = this.state |
| | | |
| | | if (value && this.state.confirmDirty) { |
| | | form.validateFields(['confirm'], { force: true }) |
| | | } |
| | | |
| | | if (level === 'letter_num' && value && /^[0-9a-zA-Z!@#$%^&*()_]*$/.test(value) && /^([^0-9]*|[^a-zA-Z]*)$/.test(value)) { |
| | | callback('密码中必须含有数字和字母。') |
| | | callback(dict['pwd_letter_num'] || '密码中必须包含数字与字母') |
| | | } else if ((level === 'char_num' || level === 'char_num_90' || level === 'char_num_90_sms') && value && /^[0-9a-zA-Z!@#$%^&*()_]*$/.test(value) && /^([^0-9]*|[^a-zA-Z]*|[^!@#$%^&*()_]*)$/.test(value)) { |
| | | callback('密码中必须含有数字、字母和特殊字符。') |
| | | callback(dict['pwd_char_num'] || '密码中必须含有数字、字母以及特殊字符') |
| | | } else { |
| | | callback() |
| | | } |
| | |
| | | render() { |
| | | const { type } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { level, delay, verdisabled } = this.state |
| | | const { level, delay, verdisabled, dict } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 } |
| | | sm: { span: 7 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | |
| | | if (level) { |
| | | rules.push({ |
| | | min: 8, |
| | | message: '密码长度不可小于8位!' |
| | | message: dict['pwd_min'] || '密码长度不可小于8位' |
| | | }) |
| | | } |
| | | |
| | | return ( |
| | | <> |
| | | {type === 'account' ? <Form {...formItemLayout} onKeyDown={this.onEnterSubmit} id="reset-password-form"> |
| | | <Form.Item label="原密码"> |
| | | <Form.Item label={dict['ori_pwd'] || '原密码'}> |
| | | {getFieldDecorator('originpwd', { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入原密码!' |
| | | message: dict['oripwd_required'] || '请输入原密码!' |
| | | } |
| | | ] |
| | | })(<Input.Password autoFocus/>)} |
| | | </Form.Item> |
| | | <Form.Item label="新密码" hasFeedback> |
| | | <Form.Item label={dict['new_pwd'] || '新密码'} hasFeedback> |
| | | {getFieldDecorator('password', { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入新密码!' |
| | | message: dict['newpwd_required'] || '请输入新密码!' |
| | | }, |
| | | { |
| | | pattern: /^[0-9a-zA-Z!@#$%^&*()_]*$/ig, |
| | | message: '密码只允许包含数字、字母以及!@#$%&*()_。' |
| | | message: dict['password_format'] || '密码只允许包含数字、字母以及!@#$%&*()_。' |
| | | }, |
| | | ...rules, |
| | | { |
| | | max: 50, |
| | | message: '最大密码长度为50位!' |
| | | message: dict['pwd_max'] || '密码长度不可超过50个字符!' |
| | | }, |
| | | { |
| | | validator: this.validateToNextPassword |
| | |
| | | ] |
| | | })(<Input.Password />)} |
| | | </Form.Item> |
| | | <Form.Item label="确认密码" hasFeedback> |
| | | <Form.Item label={dict['con_pwd'] || '确认密码'} hasFeedback> |
| | | {getFieldDecorator('confirm', { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请确认密码!' |
| | | message: dict['conpwd_required'] || '请确认密码!' |
| | | }, |
| | | { |
| | | validator: this.compareToFirstPassword |
| | |
| | | </Form.Item> |
| | | </Form> : null} |
| | | {type === 'phonepwd' ? <Form {...formItemLayout} onKeyDown={(e) => e.key === 'Enter' && this.props.resetPwdSubmit()}> |
| | | <Form.Item label="新密码" hasFeedback> |
| | | <Form.Item label={dict['new_pwd'] || '新密码'} hasFeedback> |
| | | {getFieldDecorator('password', { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入新密码!' |
| | | message: dict['newpwd_required'] || '请输入新密码!' |
| | | }, |
| | | { |
| | | pattern: /^[0-9a-zA-Z!@#$%^&*()_]*$/ig, |
| | | message: '密码只允许包含数字、字母以及!@#$%&*()_。' |
| | | message: dict['password_format'] || '密码只允许包含数字、字母以及!@#$%&*()_。' |
| | | }, |
| | | ...rules, |
| | | { |
| | | max: 50, |
| | | message: '最大密码长度为50位!' |
| | | message: dict['pwd_max'] || '密码长度不可超过50个字符!' |
| | | }, |
| | | { |
| | | validator: this.validateToNextPassword |
| | |
| | | ] |
| | | })(<Input.Password />)} |
| | | </Form.Item> |
| | | <Form.Item label="确认密码" hasFeedback> |
| | | <Form.Item label={dict['con_pwd'] || '确认密码'} hasFeedback> |
| | | {getFieldDecorator('confirm', { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请确认密码!' |
| | | message: dict['conpwd_required'] || '请确认密码!' |
| | | }, |
| | | { |
| | | validator: this.compareToFirstPassword |
| | |
| | | </Form.Item> |
| | | </Form> : null} |
| | | {type === 'mob' ? <Form {...formItemLayout} onKeyDown={(e) => e.key === 'Enter' && this.props.resetPwdSubmit()}> |
| | | <Form.Item label="手机号"> |
| | | <Form.Item label={dict['phone_no'] || '手机号'}> |
| | | {getFieldDecorator('phone', { |
| | | initialValue: '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入手机号!' |
| | | message: dict['phone_no_required'] || '请输入手机号' |
| | | } |
| | | ] |
| | | })(<Input placeholder="请输入手机号" autoComplete="off" />)} |
| | | })(<Input placeholder={dict['phone_no'] || '手机号'} autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Form> : null} |
| | | {type === 'code' ? <Form wrapperCol={{ xs: { span: 24 }, sm: { span: 20 }}} onKeyDown={(e) => e.key === 'Enter' && this.props.resetPwdSubmit()}> |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入验证码!' |
| | | message: dict['vercode_required'] || '请输入验证码' |
| | | } |
| | | ] |
| | | })(<Input |
| | | addonAfter={ |
| | | <Button type="link" size="small" disabled={verdisabled} onClick={this.getvercode}> |
| | | {delay ? `${delay}s后重新获取` : '获取验证码'} |
| | | {delay ? `${delay}s` : dict['query_vercode'] || '获取验证码'} |
| | | </Button> |
| | | } |
| | | placeholder="请输入验证码" |
| | | placeholder={dict['vercode'] || '验证码'} |
| | | autoComplete="off" |
| | | />)} |
| | | </Form.Item> |
| | |
| | | activeId: 'home_page_id', |
| | | tabviews: [{ |
| | | MenuID: 'home_page_id', |
| | | MenuName: '首页', |
| | | MenuName: window.GLOB.dict['home'] || '首页', |
| | | type: 'Home' |
| | | }] |
| | | }) |
| | |
| | | } |
| | | } |
| | | |
| | | let _href = window.location.href.split('#')[0] |
| | | let _systemMsg = localStorage.getItem(_href + 'system') |
| | | if (process.env.NODE_ENV === 'production') { // 用于校验是否存在开发权限 |
| | | let _service = window.location.href.replace(/\/admin(.*)/ig, '').replace(new RegExp(document.location.origin + '/?', 'ig'), '') |
| | | GLOB.service = _service ? _service + '/' : '' |
| | | GLOB.host = window.location.host + (_service ? '_' + _service : '') |
| | | GLOB.baseurl = document.location.origin + '/' + GLOB.service |
| | | GLOB.linkurl = GLOB.baseurl + 'index.html' |
| | | } else { |
| | | GLOB.location = config.host |
| | | GLOB.service = config.service |
| | | GLOB.host = config.host.replace(/http(s)?:\/\//ig, '') + (config.service ? '_' + config.service.replace(/\//ig, '') : '') |
| | | GLOB.baseurl = GLOB.location + '/' + GLOB.service |
| | | GLOB.linkurl = GLOB.baseurl + 'index.html' |
| | | GLOB.dataFormat = false |
| | | |
| | | let mark = sessionStorage.getItem('system_mark') |
| | | let _mark = `sys_${GLOB.service.replace('/', '') || 'service'}` |
| | | if (mark && mark !== _mark) { |
| | | sessionStorage.clear() |
| | | } |
| | | sessionStorage.setItem('system_mark', _mark) |
| | | } |
| | | |
| | | if (config.mainkey && GLOB.sysType !== 'cloud' && config.mainkey !== options.cakey) { |
| | | GLOB.localkey = GLOB.appkey |
| | | GLOB.appkey = config.mainkey |
| | | } |
| | | |
| | | let lang = localStorage.getItem(window.location.href.split('#')[0] + 'lang') || GLOB.defLang || 'zh-CN' |
| | | sessionStorage.setItem('lang', lang) |
| | | |
| | | GLOB.sysSign = GLOB.service + 'admin/' + lang + '/' |
| | | |
| | | let _systemMsg = localStorage.getItem(GLOB.sysSign + 'system') |
| | | let className = 'mk-blue-black' |
| | | |
| | | if (_systemMsg) { |
| | |
| | | GLOB.filter = true |
| | | } |
| | | |
| | | if (process.env.NODE_ENV === 'production') { // 用于校验是否存在开发权限 |
| | | let _service = window.location.href.replace(/\/admin(.*)/ig, '').replace(new RegExp(document.location.origin + '/?', 'ig'), '') |
| | | GLOB.service = _service ? _service + '/' : '' |
| | | GLOB.host = window.location.host + (_service ? '_' + _service : '') |
| | | GLOB.baseurl = document.location.origin + '/' + GLOB.service |
| | | GLOB.linkurl = GLOB.baseurl + 'index.html' |
| | | } else { |
| | | GLOB.location = config.host |
| | | GLOB.service = config.service |
| | | GLOB.host = config.host.replace(/http(s)?:\/\//ig, '') + (config.service ? '_' + config.service.replace(/\//ig, '') : '') |
| | | GLOB.baseurl = GLOB.location + '/' + GLOB.service |
| | | GLOB.linkurl = GLOB.baseurl + 'index.html' |
| | | GLOB.dataFormat = false |
| | | |
| | | let mark = sessionStorage.getItem('system_mark') |
| | | let _mark = `sys_${GLOB.service.replace('/', '') || 'service'}` |
| | | if (mark && mark !== _mark) { |
| | | sessionStorage.clear() |
| | | } |
| | | sessionStorage.setItem('system_mark', _mark) |
| | | if (lang !== 'zh-CN') { |
| | | GLOB.WXNotice = false |
| | | } |
| | | |
| | | if (config.mainkey && GLOB.sysType !== 'cloud' && config.mainkey !== options.cakey) { |
| | | GLOB.localkey = GLOB.appkey |
| | | GLOB.appkey = config.mainkey |
| | | } |
| | | |
| | | let lang = localStorage.getItem(_href + 'lang') || GLOB.defLang || 'zh-CN' |
| | | sessionStorage.setItem('lang', lang) |
| | | |
| | | if (localStorage.getItem(_href + 'files') === md5(_href + 'files')) { |
| | | let d = localStorage.getItem(_href + 'filesDate') |
| | | if (localStorage.getItem(GLOB.sysSign + 'files') === md5(GLOB.sysSign + 'files')) { |
| | | let d = localStorage.getItem(GLOB.sysSign + 'filesDate') |
| | | |
| | | GLOB.storeFiles = true |
| | | GLOB.storeDate = Math.ceil((new Date(d).getTime() - new Date().getTime()) / 86400000) |
| | |
| | | |
| | | GLOB.dict = {} |
| | | |
| | | if (localStorage.getItem(_href + 'js_trans')) { |
| | | let js_trans = JSON.parse(localStorage.getItem(_href + 'js_trans')) |
| | | if (localStorage.getItem(GLOB.sysSign + 'js_trans')) { |
| | | let js_trans = JSON.parse(localStorage.getItem(GLOB.sysSign + 'js_trans')) |
| | | |
| | | js_trans.forEach(item => { |
| | | if (lang !== item.lang) return |
| | |
| | | try { |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | |
| | | try { |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | |
| | | try { |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | |
| | | try { |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | |
| | | try { |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | |
| | | cols: columns.filter(col => !col.origin) |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | |
| | | cols: [column] |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | |
| | | cols: columns.filter(col => !col.origin) |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | |
| | | cols: [column] |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | |
| | | cols: columns.filter(col => !col.origin) |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | |
| | | <Form.Item label="可用字段" className="field-able"> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, LoginUID, SessionUid, UserID, Appkey, lang, time_id, typename, datam</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'排序、分页以及搜索条件变量,请按照@xxx@格式使用。使用@pageSize@或@orderBy@代表自定义分页,总数请以mk_total返回。'}>orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}{type === 'calendar' ? ', mk_year' : ''}{hasExtend ? ', mk_time' : ''}</Tooltip> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'排序、分页以及搜索条件变量,请按照@xxx@格式使用。使用@pageSize@、@orderBy@ 或脚本中存在 @mk_total 代表自定义分页,总数请以mk_total返回。'}>orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}{type === 'calendar' ? ', mk_year' : ''}{hasExtend ? ', mk_time' : ''}</Tooltip> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'url变量,请按照@xxx@格式使用。'}>{urlFields ? ', ' : ''}<span style={{color: '#13c2c2'}}>{urlFields}</span></Tooltip> |
| | | {window.GLOB.process ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'工作流变量,请按照@xxx@格式使用。'}>, <span style={{color: 'purple'}}>works_flow_code</span></Tooltip> : null} |
| | | </Form.Item> |
| | |
| | | } |
| | | |
| | | // 正则替换 |
| | | let custompage = /@pageSize@|@orderBy@/i.test(_dataresource + _customScript) |
| | | let custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript) |
| | | let _regoptions = getSearchRegs(searches) |
| | | |
| | | let _search = joinMainSearchkey(searches) |
| | |
| | | item.setting.dataresource = _dataresource |
| | | item.setting.customScript = _customScript |
| | | |
| | | let custompage = /@pageSize@|@orderBy@/i.test(_dataresource + _customScript) |
| | | let custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript) |
| | | |
| | | if (_dataresource) { |
| | | if (custompage) { |
| | |
| | | copy = (item) => { |
| | | let msg = { key: 'interface', type: 'line', data: item } |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | msg.$srcId = srcid |
| | | } |
| | |
| | | } |
| | | } else if (menu.param.type === 'app') { |
| | | if (menu.param.typename !== 'pc') { |
| | | let _param = {...menu.param} |
| | | let _param = {...menu.param, lang: sessionStorage.getItem('lang')} |
| | | _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param))) |
| | | window.open(`#/mobdesign/${_param}`) |
| | | } else { |
| | | let _param = {...menu.param} |
| | | let _param = {...menu.param, lang: sessionStorage.getItem('lang')} |
| | | _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param))) |
| | | window.open(`#/pcdesign/${_param}`) |
| | | } |
| | |
| | | '#eb2f96', '#aeb303', '#c32539', '#1d3661', '#ffd591', '#ffe58f', '#fffb8f', '#eaff8f', '#b7eb8f', '#87e8de', '#91d5ff', |
| | | '#adc6ff', '#EBE9E9', '#d9d9d9', 'rgba(0, 0, 0, 0.65)', 'rgba(0, 0, 0, 0.85)', '#000000', '#ffffff', 'transparent' |
| | | ] |
| | | const _href = window.location.href.split('#')[0] |
| | | let loading = false |
| | | |
| | | class ColorSketch extends Component { |
| | |
| | | |
| | | getColors = (appColors) => { |
| | | let colors = JSON.parse(JSON.stringify(presetColors)) |
| | | let normal_colors = localStorage.getItem(_href + 'normal_colors') |
| | | let normal_colors = localStorage.getItem(window.GLOB.sysSign + 'normal_colors') |
| | | |
| | | if (normal_colors) { |
| | | try { |
| | |
| | | const { initVal, color } = this.state |
| | | |
| | | if (!status && color && color !== initVal && color !== 'rgba(0, 0, 0, 0)' && color !== 'transparent' && !/rgba\(\d+,\s*\d+,\s*\d+,\s*0\)/.test(color)) { |
| | | let normal_colors = localStorage.getItem(_href + 'normal_colors') |
| | | let normal_colors = localStorage.getItem(window.GLOB.sysSign + 'normal_colors') |
| | | |
| | | if (normal_colors) { |
| | | try { |
| | |
| | | normal_colors.length = 10 |
| | | } |
| | | |
| | | localStorage.setItem(_href + 'normal_colors', JSON.stringify(normal_colors)) |
| | | localStorage.setItem(window.GLOB.sysSign + 'normal_colors', JSON.stringify(normal_colors)) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | delete val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | |
| | | |
| | | delete val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | |
| | | component.setting.customScript = _customScript // 整理后自定义脚本 |
| | | component.setting.tailScript = _tailScript // 后置自定义脚本 |
| | | |
| | | component.setting.custompage = /@pageSize@|@orderBy@/i.test(component.setting.dataresource + component.setting.customScript) |
| | | component.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(component.setting.dataresource + component.setting.customScript) |
| | | |
| | | if (!component.setting.execute || component.setting.custompage) { |
| | | component.forbidLine = true |
| | |
| | | item.setting.customScript = _customScript // 整理后自定义脚本 |
| | | item.setting.tailScript = _tailScript // 后置自定义脚本 |
| | | |
| | | item.setting.custompage = /@pageSize@|@orderBy@/i.test(item.setting.dataresource + item.setting.customScript) |
| | | item.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(item.setting.dataresource + item.setting.customScript) |
| | | |
| | | return item |
| | | } |
| | |
| | | item.setting.customScript = _customScript // 整理后自定义脚本 |
| | | item.setting.tailScript = _tailScript // 后置自定义脚本 |
| | | |
| | | item.setting.custompage = /@pageSize@|@orderBy@/i.test(item.setting.dataresource + item.setting.customScript) |
| | | item.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(item.setting.dataresource + item.setting.customScript) |
| | | |
| | | if (!item.setting.execute || item.setting.custompage) { |
| | | item.forbidLine = true |
| | |
| | | inter.setting.customScript = _customScript // 整理后自定义脚本 |
| | | inter.setting.tailScript = _tailScript // 后置自定义脚本 |
| | | |
| | | inter.setting.custompage = /@pageSize@|@orderBy@/i.test(inter.setting.dataresource + inter.setting.customScript) |
| | | inter.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(inter.setting.dataresource + inter.setting.customScript) |
| | | |
| | | return inter |
| | | }) |
| | |
| | | item.setting.customScript = _customScript // 整理后自定义脚本 |
| | | item.setting.tailScript = _tailScript // 后置自定义脚本 |
| | | |
| | | item.setting.custompage = /@pageSize@|@orderBy@/i.test(item.setting.dataresource + item.setting.customScript) |
| | | item.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(item.setting.dataresource + item.setting.customScript) |
| | | |
| | | if (!item.setting.execute || item.setting.custompage) { |
| | | item.forbidLine = true |
| | |
| | | _tailScript = _tailScript.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') |
| | | } |
| | | |
| | | if (btn.$flowId && window.GLOB.UserCacheMap.has(btn.$flowId)) { |
| | | let flow = window.GLOB.UserCacheMap.get(btn.$flowId) |
| | | _setting.dataresource = _setting.dataresource.replace(/@works_flow_code@/ig, `'${flow.flow_code}'`) |
| | | _customScript = _customScript.replace(/@works_flow_code@/ig, `'${flow.flow_code}'`) |
| | | _tailScript = _tailScript.replace(/@works_flow_code@/ig, `'${flow.flow_code}'`) |
| | | } |
| | | |
| | | _setting.customScript = _customScript // 整理后自定义脚本 |
| | | _setting.tailScript = _tailScript // 后置自定义脚本 |
| | | |
| | | _setting.laypage = pagination |
| | | _setting.custompage = /@pageSize@|@orderBy@/i.test(_setting.dataresource + _setting.customScript) |
| | | _setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_setting.dataresource + _setting.customScript) |
| | | |
| | | _setting.queryType = btn.verify.queryType |
| | | _setting.$name = btn.logLabel |
| | |
| | | } |
| | | |
| | | let isDataM = sessionStorage.getItem('dataM') === 'true' |
| | | let custompage = /@pageSize@|@orderBy@/i.test(_dataresource + _customScript + _tailScript) |
| | | let custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript + _tailScript) |
| | | let regoptions = [ |
| | | { reg: /@orderBy@/ig, value: btn.verify.setting.order }, |
| | | { reg: /@pageSize@/ig, value: '9999' }, |
| | |
| | | |
| | | delete val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | |
| | | } |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | | } |
| | | |
| | | let custompage = /@pageSize@|@orderBy@/i.test(_dataresource + _customScript) |
| | | let custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript) |
| | | |
| | | // 正则替换 |
| | | regoptions.push({ |
| | |
| | | value: '' |
| | | }) |
| | | |
| | | if (window.GLOB.process) { |
| | | regoptions.push({reg: /@works_flow_code@/ig, value: `'mk_flow_code'`}) |
| | | } |
| | | |
| | | regoptions.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | _customScript = _customScript.replace(item.reg, item.value) |
| | |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | | } |
| | | |
| | | let custompage = /@pageSize@|@orderBy@/i.test(_dataresource + _customScript) |
| | | let custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript) |
| | | |
| | | // 正则替换 |
| | | let regoptions = [{ |
| | |
| | | columns: columnlist |
| | | } |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | val.$srcId = srcid |
| | | } |
| | |
| | | try { |
| | | delete _val.$srcId |
| | | |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | _val.$srcId = srcid |
| | | } |
| | |
| | | return |
| | | } |
| | | |
| | | let _href = window.location.href.split('#')[0] |
| | | localStorage.setItem(_href + 'sql_char', JSON.stringify([res.origin, res.value])) |
| | | localStorage.setItem(window.GLOB.sysSign + 'sql_char', JSON.stringify([res.origin, res.value])) |
| | | |
| | | _sql = _sql.replace(reg, res.value) |
| | | |
| | |
| | | } |
| | | |
| | | try { |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid) { |
| | | msg.$srcId = srcid |
| | | } |
| | |
| | | _config = JSON.parse(window.decodeURIComponent(window.atob(_config))) |
| | | |
| | | if (typeof(_config) === 'object' && _config.$srcId) { |
| | | let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId') |
| | | let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') |
| | | if (srcid && _config.$srcId !== srcid) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | |
| | | if (item.type === 'navbar') { |
| | | item.uuid = item.uuid.slice(0, 24) + tail |
| | | } else if (item.type === 'login') { |
| | | item.wrap.linkmenu = item.wrap.linkmenu.slice(0, 24) + tail |
| | | } else if (item.type === 'menubar') { |
| | | item.subMenus = item.subMenus.map(cell => { |
| | | if (cell.setting.name && menuDict[cell.setting.name]) { |
| | |
| | | }) |
| | | |
| | | if (!selectApp && applist[0]) { |
| | | let _href = window.location.href.split('#')[0] + 'app_record' |
| | | let record = localStorage.getItem(_href) |
| | | let record = localStorage.getItem(window.GLOB.sysSign + 'app_record') |
| | | record = record ? JSON.parse(record) : null |
| | | |
| | | if (record && record.dates) { |
| | |
| | | }) |
| | | |
| | | if (reset) { |
| | | localStorage.setItem(_href, JSON.stringify(record)) |
| | | localStorage.setItem(window.GLOB.sysSign + 'app_record', JSON.stringify(record)) |
| | | } |
| | | } |
| | | } |
| | |
| | | jumpApp = (item) => { |
| | | const { selectApp } = this.state |
| | | |
| | | let _href = window.location.href.split('#')[0] + 'app_record' |
| | | let record = localStorage.getItem(_href) |
| | | let record = localStorage.getItem(window.GLOB.sysSign + 'app_record') |
| | | record = record ? JSON.parse(record) : null |
| | | |
| | | if (!record || !record.dates) { |
| | | localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID, dates: {[selectApp.ID]: new Date().getTime()}})) |
| | | localStorage.setItem(window.GLOB.sysSign + 'app_record', JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID, dates: {[selectApp.ID]: new Date().getTime()}})) |
| | | } else { |
| | | 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()}})) |
| | | localStorage.setItem(window.GLOB.sysSign + 'app_record', 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})) |
| | | localStorage.setItem(window.GLOB.sysSign + 'app_record', JSON.stringify({...record, preId: selectApp.ID})) |
| | | } |
| | | } |
| | | |
| | |
| | | ID = selectApp.ID |
| | | } else { |
| | | let lowerKei = res.kei_no.toLowerCase() |
| | | if (lowerKei === 'mob') { |
| | | if (['mob', 'pad', 'pc', 'admin'].includes(lowerKei)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '应用编码不允许使用mob!', |
| | | message: '应用编码不允许使用mob、pad、pc、admin!', |
| | | duration: 3 |
| | | }) |
| | | return |
| | |
| | | let param = { |
| | | MenuID: config.wrap.linkmenu, |
| | | copyMenuId: '', |
| | | type: 'view' |
| | | type: 'view', |
| | | lang: sessionStorage.getItem('lang') |
| | | } |
| | | |
| | | param = window.btoa(window.encodeURIComponent(JSON.stringify(param))) |
| | |
| | | const Resetpwd = asyncLoadComponent(() => import('@/components/resetPassword')) |
| | | const LoginCloudForm = asyncComponent(() => import('./logincloudform')) |
| | | |
| | | const _href = window.location.href.split('#')[0] |
| | | |
| | | class Login extends Component { |
| | | state = { |
| | | isDisabled: false, |
| | |
| | | window.GLOB.externalDatabase = `[${res.paas_externalDatabase}]..` |
| | | } |
| | | |
| | | localStorage.setItem(_href + 'lang', param.lang || 'zh-CN') |
| | | sessionStorage.setItem('lang', param.lang || 'zh-CN') |
| | | |
| | | sessionStorage.removeItem('visitorUserID') |
| | | sessionStorage.removeItem('visitorLoginUID') |
| | | |
| | | let users = localStorage.getItem(_href + 'users') |
| | | let users = localStorage.getItem(window.GLOB.sysSign + 'users') |
| | | |
| | | if (users) { |
| | | try { |
| | |
| | | |
| | | users.unshift({username: param.username, password: param.remember ? param.password : ''}) |
| | | |
| | | localStorage.setItem(_href + 'users', window.btoa(window.encodeURIComponent(JSON.stringify(users)))) |
| | | localStorage.setItem(window.GLOB.sysSign + 'users', window.btoa(window.encodeURIComponent(JSON.stringify(users)))) |
| | | |
| | | let level = localStorage.getItem(_href + 'pwdlevel') |
| | | let level = localStorage.getItem(window.GLOB.sysSign + 'pwdlevel') |
| | | |
| | | if (level && process.env.NODE_ENV === 'production') { |
| | | let visible = false |
| | |
| | | sessionStorage.setItem('externalDatabase', res.paas_externalDatabase) |
| | | window.GLOB.externalDatabase = `[${res.paas_externalDatabase}]..` |
| | | } |
| | | |
| | | localStorage.setItem(_href + 'lang', param.lang || 'zh-CN') |
| | | sessionStorage.setItem('lang', param.lang || 'zh-CN') |
| | | |
| | | sessionStorage.removeItem('visitorUserID') |
| | | sessionStorage.removeItem('visitorLoginUID') |
| | |
| | | } |
| | | } |
| | | |
| | | const _addressUrl = _href + 'queryAddress' |
| | | const _addressUrl = window.location.href.split('#')[0] + 'queryAddress' |
| | | |
| | | if (localStorage.getItem(_addressUrl) === 'true') { |
| | | this.queryAddress() |
| | | } |
| | | |
| | | const timeStamp = new Date().getTime() |
| | | const _authUrl = _href + 'AuthCode' |
| | | const _authUrl = window.location.href.split('#')[0] + 'AuthCode' |
| | | |
| | | let authCode = localStorage.getItem(_authUrl) |
| | | let _s = md5('mksoft' + moment().format('YYYYMMDD')) |
| | |
| | | lictime = Math.floor(new Date(lictime).getTime() / 86400000) |
| | | let curtime = Math.floor(new Date().getTime() / 86400000) |
| | | let licday = lictime - curtime |
| | | let _mindUrl = _href + 'notMind' |
| | | let _mindUrl = window.location.href.split('#')[0] + 'notMind' |
| | | |
| | | if (licday < 0 || isNaN(licday)) { |
| | | Modal.warning({ |
| | |
| | | localStorage.setItem(_authUrl, box) |
| | | |
| | | if (res.e_files === 'true') { |
| | | localStorage.setItem(_href + 'files', md5(_href + 'files')) |
| | | localStorage.setItem(_href + 'filesDate', res.e_files_end_date) |
| | | localStorage.setItem(window.GLOB.sysSign + 'files', md5(window.GLOB.sysSign + 'files')) |
| | | localStorage.setItem(window.GLOB.sysSign + 'filesDate', res.e_files_end_date) |
| | | window.GLOB.storeFiles = true |
| | | window.GLOB.storeDate = Math.ceil((new Date(res.e_files_end_date).getTime() - new Date().getTime()) / 86400000) |
| | | } else { |
| | | localStorage.removeItem(_href + 'files') |
| | | localStorage.removeItem(window.GLOB.sysSign + 'files') |
| | | window.GLOB.storeFiles = false |
| | | } |
| | | |
| | |
| | | } |
| | | } else { |
| | | localStorage.removeItem(_authUrl) |
| | | localStorage.removeItem(_href + 'files') |
| | | localStorage.removeItem(window.GLOB.sysSign + 'files') |
| | | window.GLOB.storeFiles = false |
| | | |
| | | this.setState({ |
| | |
| | | res.menu_type = 'shutter' |
| | | } |
| | | |
| | | let _url = _href + 'system' |
| | | let systemMsg = { |
| | | favicon: res.titlelogo || '', |
| | | platTitle: res.titleName || '', |
| | |
| | | level = '' |
| | | } |
| | | |
| | | localStorage.setItem(_href + 'pwdlevel', level) |
| | | localStorage.setItem(window.GLOB.sysSign + 'pwdlevel', level) |
| | | |
| | | if (res.srcid) { |
| | | localStorage.setItem(_href + 'srcId', res.srcid) |
| | | localStorage.setItem(window.GLOB.sysSign + 'srcId', res.srcid) |
| | | } else { |
| | | localStorage.removeItem(_href + 'srcId') |
| | | localStorage.removeItem(window.GLOB.sysSign + 'srcId') |
| | | } |
| | | |
| | | sessionStorage.setItem('home_background', res.index_background_color || '') |
| | |
| | | document.title = systemMsg.platTitle |
| | | |
| | | try { |
| | | localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify(systemMsg)))) |
| | | localStorage.setItem(window.GLOB.sysSign + 'system', window.btoa(window.encodeURIComponent(JSON.stringify(systemMsg)))) |
| | | } catch (e) { |
| | | localStorage.removeItem(_url) |
| | | localStorage.removeItem(window.GLOB.sysSign + 'system') |
| | | } |
| | | |
| | | |
| | | if (res.lang_translation_js && res.lang_data && res.lang_data[0] && (res.lang_data.length > 1 || res.lang_data[0].Lang !== 'zh-CN')) { |
| | | let lang = sessionStorage.getItem('lang') |
| | | let js_trans = res.lang_translation_js.map(item => { |
| | |
| | | } |
| | | }) |
| | | |
| | | localStorage.setItem(_href + 'js_trans', JSON.stringify(js_trans)) |
| | | localStorage.setItem(window.GLOB.sysSign + 'js_trans', JSON.stringify(js_trans)) |
| | | } |
| | | |
| | | let _loginurl = _href + 'loginways' |
| | | let _loginurl = window.GLOB.sysSign + 'loginways' |
| | | let login_ways = [] |
| | | if (res.login_ways && res.login_ways.length > 0) { |
| | | res.login_ways.forEach(item => { |
| | |
| | | sessionStorage.setItem('subLangList', JSON.stringify(list)) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (res.lang_data.length === 1 && res.lang_data[0].Lang !== sessionStorage.getItem('lang')) { |
| | | localStorage.setItem(window.location.href.split('#')[0] + 'lang', res.lang_data[0].Lang) |
| | | sessionStorage.setItem('lang', res.lang_data[0].Lang) |
| | | window.location.reload() |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } |
| | | }) |
| | | |
| | | let loginWays = localStorage.getItem(_href + 'loginways') |
| | | let loginWays = localStorage.getItem(window.GLOB.sysSign + 'loginways') |
| | | if (loginWays) { |
| | | try { |
| | | loginWays = JSON.parse(window.decodeURIComponent(window.atob(loginWays))) |
| | |
| | | UNSAFE_componentWillMount () { |
| | | const { loginWays } = this.props |
| | | let remember = true |
| | | let _url = window.location.href.split('#')[0] |
| | | |
| | | if (localStorage.getItem(window.location.href.split('#')[0] + 'users')) { // 过渡 |
| | | localStorage.setItem(window.GLOB.sysSign + 'users', localStorage.getItem(window.location.href.split('#')[0] + 'users')) |
| | | localStorage.setItem(window.GLOB.sysSign + 'remember', localStorage.getItem(window.location.href.split('#')[0] + 'remember')) |
| | | localStorage.removeItem(window.location.href.split('#')[0] + 'users') |
| | | } |
| | | |
| | | if (localStorage.getItem(_url + 'remember') === 'false') { |
| | | if (localStorage.getItem(window.GLOB.sysSign + 'remember') === 'false') { |
| | | remember = false |
| | | } |
| | | if (!window.GLOB.keepKey) { |
| | |
| | | }) |
| | | |
| | | let activeKey = _loginWays[0].type |
| | | |
| | | let users = localStorage.getItem(_url + 'users') |
| | | |
| | | let users = localStorage.getItem(window.GLOB.sysSign + 'users') |
| | | let _user = null |
| | | |
| | | if (users) { |
| | |
| | | } |
| | | |
| | | changelang = (val) => { |
| | | const _href = window.location.href.split('#')[0] |
| | | localStorage.setItem(_href + 'lang', val) |
| | | localStorage.setItem(window.location.href.split('#')[0] + 'lang', val) |
| | | sessionStorage.setItem('lang', val) |
| | | |
| | | window.location.reload() |
| | |
| | | |
| | | rememberChange = (e) => { |
| | | let val = e.target.checked |
| | | let _url = window.location.href.split('#')[0] |
| | | |
| | | localStorage.setItem(_url + 'remember', val) |
| | | localStorage.setItem(window.GLOB.sysSign + 'remember', val) |
| | | } |
| | | |
| | | complete = (val) => { |
| | |
| | | |
| | | this.setState({users: _users}) |
| | | |
| | | let _url = window.location.href.split('#')[0] |
| | | |
| | | localStorage.setItem(_url + 'users', window.btoa(window.encodeURIComponent(JSON.stringify(_users)))) |
| | | localStorage.setItem(window.GLOB.sysSign + 'users', window.btoa(window.encodeURIComponent(JSON.stringify(_users)))) |
| | | } |
| | | |
| | | /** |
| | |
| | | MenuID: menu.MenuID, |
| | | copyMenuId: menu.copyMenuId || '', |
| | | clearMenu: menu.clearMenu !== 'false', |
| | | type: 'view' |
| | | type: 'view', |
| | | lang: sessionStorage.getItem('lang') |
| | | } |
| | | |
| | | param.MenuNo = menu.MenuNo || '' |
| | |
| | | MenuID: menu.MenuID, |
| | | copyMenuId: menu.copyMenuId || '', |
| | | clearMenu: menu.clearMenu !== 'false', |
| | | type: 'view' |
| | | type: 'view', |
| | | lang: sessionStorage.getItem('lang') |
| | | } |
| | | |
| | | // param.MenuNo = menu.MenuNo || '' |
| | |
| | | res.menu_type = 'shutter' |
| | | } |
| | | |
| | | const _href = window.location.href.split('#')[0] |
| | | let _url = _href + 'system' |
| | | let systemMsg = { |
| | | favicon: res.titlelogo || '', |
| | | platTitle: res.titleName || '', |
| | |
| | | level = '' |
| | | } |
| | | |
| | | localStorage.setItem(_href + 'pwdlevel', level) |
| | | localStorage.setItem(window.GLOB.sysSign + 'pwdlevel', level) |
| | | |
| | | if (res.srcid) { |
| | | localStorage.setItem(_href + 'srcId', res.srcid) |
| | | localStorage.setItem(window.GLOB.sysSign + 'srcId', res.srcid) |
| | | } else { |
| | | localStorage.removeItem(_href + 'srcId') |
| | | localStorage.removeItem(window.GLOB.sysSign + 'srcId') |
| | | } |
| | | |
| | | sessionStorage.setItem('home_background', res.index_background_color || '') |
| | |
| | | document.title = systemMsg.platTitle |
| | | |
| | | try { |
| | | localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify(systemMsg)))) |
| | | localStorage.setItem(window.GLOB.sysSign + 'system', window.btoa(window.encodeURIComponent(JSON.stringify(systemMsg)))) |
| | | } catch (e) { |
| | | localStorage.removeItem(_url) |
| | | localStorage.removeItem(window.GLOB.sysSign + 'system') |
| | | } |
| | | |
| | | window.GLOB.mainlogo = systemMsg.mainlogo |