king
2021-11-22 2eb57414b648430420cf56d432aeddb5a72ad30c
2021-11-22
4个文件已修改
81 ■■■■ 已修改文件
public/options.json 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/loginform.jsx 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtable/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/options.json
@@ -1,17 +1,17 @@
{
  "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/"
}
src/components/header/index.jsx
@@ -406,6 +406,12 @@
          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')
src/components/header/loginform.jsx
@@ -1,6 +1,6 @@
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'
@@ -11,7 +11,35 @@
  }
  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 = () => {
@@ -41,6 +69,15 @@
    }
  }
  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()
@@ -48,13 +85,14 @@
  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)' }} />}
@@ -64,9 +102,9 @@
            />
          )}
        </Form.Item>
        <Form.Item>
        <Form.Item style={{marginBottom: '15px'}}>
          {getFieldDecorator('password', {
            initialValue: '',
            initialValue: password,
            rules: [
              {
                required: true,
@@ -75,6 +113,13 @@
            ]
          })(<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>
    )
  }
src/tabviews/subtable/index.jsx
@@ -83,7 +83,7 @@
   * @description 获取页面配置信息
   */
  async loadconfig () {
    const { permAction, permMenus, Tab, BID, BData } = this.props
    const { permAction, permMenus, Tab } = this.props
    let param = {
      func: 'sPC_Get_LongParam',
@@ -322,8 +322,8 @@
      this.setState({
        pageSize: config.setting.pageSize || 10,
        BID: BID || '',
        BData: BData || '',
        BID: this.props.BID || '',
        BData: this.props.BData || '',
        loadingview: false,
        chartId,
        config,
@@ -337,7 +337,7 @@
        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()
        }
      })