king
2020-06-28 48a18736c461ad730bd264b0ac7b40b68a0e33a1
src/views/login/index.jsx
@@ -1,20 +1,21 @@
import React, {Component} from 'react'
import React, { Component } from 'react'
import { message, Modal } from 'antd'
import {connect} from 'react-redux'
import { connect } from 'react-redux'
import md5 from 'md5'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import options from '@/store/options.js'
import zhCN from '@/locales/zh-CN/login.js'
import enUS from '@/locales/en-US/login.js'
import options from '@/store/options.js'
import Utils from '@/utils/utils.js'
import asyncLoadComponent from '@/utils/asyncLoadComponent'
import { modifyMemberLevel } from '@/store/action'
import './index.scss'
const LoginForm = asyncLoadComponent(() => import('./loginform'))
const LoginCloudForm = asyncLoadComponent(() => import('./logincloudform'))
const iszhCN = !localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN'
const iszhCN = localStorage.getItem('lang') !== 'en-US'
class Login extends Component {
  state = {
@@ -57,7 +58,7 @@
  }
  async loginsubmit (param) {
    if (options.systemType === 'local' && !window.GLOB.mainSystemApi) { // 业务系统必须设置单点地址
    if (options.sysType === 'local' && !window.GLOB.mainSystemApi) { // 业务系统必须设置单点地址
      Modal.warning({
        title: '未设置单点服务器地址,请联系管理员!'
      })
@@ -90,7 +91,7 @@
      } else {
        this.props.history.replace('/main')
      }
    } else if (res.ErrCode === 'Need_Get_Appkey' && options.systemType === 'SSO') {
    } else if (res.ErrCode === 'Need_Get_Appkey' && options.sysType === 'SSO') {
      message.warning('应用尚未创建,请向云端同步应用!')
      this.setState({
@@ -109,8 +110,8 @@
    let timeStamp = new Date().getTime()
    let _appId = window.GLOB.appId
    if (options.systemType === 'cloud') { // 云端使用系统配置appid
      _appId = options.AppId
    if (options.sysType === 'cloud') { // 云端使用系统配置appid
      _appId = options.caId
    }
    let str = md5('MK19' + _appId + timeStamp)
@@ -235,7 +236,7 @@
      func: 's_get_app_from_cloud',
      UserName: '',
      Password: '',
      systemType: options.systemType,
      systemType: options.sysType,
      Type: 'X',
      debug: 'Y'
    }
@@ -262,6 +263,10 @@
            Appkey: window.GLOB.appkey || ''
          }
          _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
          _param.secretkey = Utils.encrypt(_param.LTextOut, _param.timestamp)
          _param.open_key = Utils.encrypt(_param.secretkey, _param.timestamp, true)
          Api.dostarInterface(_param).then(response => {
            if (response.status) {
              message.success('应用创建成功。')