| | |
| | | { |
| | | "appId": "201912040924165801464FF1788654BC5AC73", |
| | | "appkey": "20191106103859640976D6E924E464D029CF0", |
| | | "appId": "202108312122504607B107A83F55B40C98CCF", |
| | | "appkey": "20210831212235413F287EC3BF489424496C8", |
| | | "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", |
| | | "systemType": "", |
| | | "externalDatabase": "false", |
| | | "externalDatabase": "", |
| | | "lineColor": "", |
| | | "filter": "false", |
| | | "defaultApp": "", |
| | | "defaultLang": "zh-CN", |
| | | "WXAppID": "", |
| | | "debugger": false, |
| | | "licenseKey": "E1A8FE", |
| | | "licenseKey": "", |
| | | "probation": "", |
| | | "host": "http://qingqiumarket.cn", |
| | | "service": "mkwms/" |
| | | "host": "http://demo.mk9h.cn", |
| | | "service": "erp_new/" |
| | | } |
| | |
| | | sessionStorage.setItem('dataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | if (param.remember) { |
| | | let _url = window.location.href.split('#')[0] + 'cloud' |
| | | |
| | | localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: param.password})))) |
| | | } |
| | | |
| | | this.setSystemFuncs() |
| | | this.props.modifyMainMenu(null) |
| | | this.props.history.replace('/design') |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Icon, Input } from 'antd' |
| | | import { Form, Icon, Input, Checkbox } from 'antd' |
| | | import zhCN from '@/locales/zh-CN/login.js' |
| | | import enUS from '@/locales/en-US/login.js' |
| | | import './index.scss' |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | remember: false, |
| | | username: '', |
| | | password: '' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let _url = window.location.href.split('#')[0] + 'cloud' |
| | | let _user = localStorage.getItem(_url) |
| | | |
| | | if (_user) { |
| | | try { |
| | | _user = JSON.parse(window.decodeURIComponent(window.atob(_user))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | _user = '' |
| | | } |
| | | } |
| | | |
| | | if (_user && new Date().getTime() - _user.time > 1000 * 7 * 24 * 60 * 60) { |
| | | _user = '' |
| | | localStorage.removeItem(_url) |
| | | } |
| | | |
| | | this.setState({ |
| | | remember: _user ? true : false, |
| | | username: _user ? _user.username : '', |
| | | password: _user ? _user.password : '' |
| | | }) |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | } |
| | | } |
| | | |
| | | rememberChange = (e) => { |
| | | let val = e.target.checked |
| | | let _url = window.location.href.split('#')[0] + 'cloud' |
| | | |
| | | if (!val) { |
| | | localStorage.removeItem(_url) |
| | | } |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const input = document.getElementById('username') |
| | | input && input.focus() |
| | |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { remember, username, password } = this.state |
| | | |
| | | return ( |
| | | <Form style={{margin: '0px 10px'}}> |
| | | <Form.Item> |
| | | {getFieldDecorator('username', { |
| | | rules: [{ required: true, message: this.state.dict['login.username.empty'] }], |
| | | initialValue: '', |
| | | initialValue: username, |
| | | })( |
| | | <Input |
| | | prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />} |
| | |
| | | /> |
| | | )} |
| | | </Form.Item> |
| | | <Form.Item> |
| | | <Form.Item style={{marginBottom: '15px'}}> |
| | | {getFieldDecorator('password', { |
| | | initialValue: '', |
| | | initialValue: password, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | ] |
| | | })(<Input.Password onPressEnter={(e) => {this.handleSubmit(e, 'username')}} placeholder={this.state.dict['login.password']} prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />} />)} |
| | | </Form.Item> |
| | | <Form.Item style={{marginBottom: '10px'}}> |
| | | {getFieldDecorator('remember', { |
| | | valuePropName: 'checked', |
| | | initialValue: remember, |
| | | })( |
| | | <Checkbox onChange={this.rememberChange}>记住密码</Checkbox>)} |
| | | </Form.Item> |
| | | </Form> |
| | | ) |
| | | } |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { permAction, permMenus, Tab, BID, BData } = this.props |
| | | const { permAction, permMenus, Tab } = this.props |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | |
| | | this.setState({ |
| | | pageSize: config.setting.pageSize || 10, |
| | | BID: BID || '', |
| | | BData: BData || '', |
| | | BID: this.props.BID || '', |
| | | BData: this.props.BData || '', |
| | | loadingview: false, |
| | | chartId, |
| | | config, |
| | |
| | | search: Utils.initMainSearch(config.search), |
| | | hasReqFields |
| | | }, () => { |
| | | if (config.setting.onload !== 'false' && (!Tab.supMenu || BID || Tab.isTreeNode)) { // 初始化可加载 |
| | | if (config.setting.onload !== 'false' && (!Tab.supMenu || this.props.BID || Tab.isTreeNode)) { // 初始化可加载 |
| | | this.loadData() |
| | | } |
| | | }) |