king
2020-03-30 461e4fff4b51d067671244eec63b097cd9012b6e
src/views/login/index.jsx
@@ -8,11 +8,13 @@
import options from '@/store/options.js'
import Utils from '@/utils/utils.js'
import asyncComponent from '@/utils/asyncComponent'
import asyncLoadComponent from '@/utils/asyncLoadComponent'
import logourl from '@/assets/img/login-logo.png'
import loginbg from '@/assets/img/loginbg.jpg'
import './index.scss'
const LoginForm = asyncComponent(() => import('./loginform'))
const LoginForm = asyncLoadComponent(() => import('./loginform'))
const Action = asyncComponent(() => import('@/tabviews/zshare/actionList'))
const iszhCN = !localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN'
class Login extends Component {
@@ -28,7 +30,8 @@
    ICP: window.GLOB.icp || 'ICP备案: 京ICP备12007830号',
    bgColor: window.GLOB.bgColor || '#000000',
    lineColor: window.GLOB.lineColor || '#1890ff',
    website: window.GLOB.website || (!window.GLOB.copyRight && 'http://minkesoft.com')
    website: window.GLOB.website || (!window.GLOB.copyRight && 'http://minkesoft.com'),
    loaded: false
  }
  changelang (item) {
@@ -61,6 +64,7 @@
      sessionStorage.setItem('SessionUid', Utils.getuuid())
      sessionStorage.setItem('LoginUID', res.LoginUID)
      sessionStorage.setItem('User_Name', res.UserName)
      sessionStorage.setItem('Full_Name', res.FullName)
      sessionStorage.setItem('avatar', res.icon || '')
      
      localStorage.setItem('lang', param.lang)
@@ -91,29 +95,31 @@
    let timeStamp = new Date().getTime()
    let _appId = window.GLOB.appId
    if (options.systemType === 'Cloud') { // 云端使用系统配置appid
    if (options.systemType === 'cloud') { // 云端使用系统配置appid
      _appId = options.AppId
    }
    let str = md5('MK19' + _appId + timeStamp)
    Api.systemauth(_appId, timeStamp).then(res => {
      if (res.status && res.EPC === str) {
        let box = []
        for (let i = 0; i < 15; i++) {
          let s = 'mksoft' + moment().add(i, 'days').format('YYYYMMDD')
          box.push(md5(s))
      if (res.status) {
        if (res.EPC === str) {
          let box = []
          for (let i = 0; i < 15; i++) {
            let s = 'mksoft' + moment().add(i, 'days').format('YYYYMMDD')
            box.push(md5(s))
          }
          box = box.join(',')
          localStorage.setItem('AuthCode', box)
          this.setState({
            auth: true
          })
        } else {
          localStorage.removeItem('AuthCode')
          this.setState({
            auth: false
          })
        }
        box = box.join(',')
        localStorage.setItem('AuthCode', box)
        this.setState({
          auth: true
        })
      } else {
        localStorage.removeItem('AuthCode')
        this.setState({
          auth: false
        })
      }
    })
@@ -124,6 +130,12 @@
        auth: true
      })
    }
    // let link = document.querySelector("link[rel*='icon']") || document.createElement('link')
    // link.type = 'image/x-icon'
    // link.rel = 'shortcut icon'
    // link.href = 'http://www.stackoverflow.com/favicon.ico'
    // document.getElementsByTagName('head')[0].appendChild(link)
  }
  render () {
@@ -142,6 +154,7 @@
            isDisabled={this.state.isDisabled}
            changelang={(value) => this.changelang(value)}
            handleSubmit={() => this.handleSubmit()}
            handleloaded={() => {this.setState({loaded: true})}}
            wrappedComponentRef={(inst) => this.loginformRef = inst}
          />
        </div>
@@ -152,6 +165,25 @@
          }
          <p dangerouslySetInnerHTML={{ __html: this.state.ICP.replace(/\s/ig, '&nbsp;') }}></p>
        </div>
        {this.state.loaded ? <div style={{position: 'fixed', bottom: '-300px'}}>
          <Action
            BID=""
            type=""
            menuType=""
            setting={{}}
            actions={[]}
            triggerBtn={{}}
            dict={{}}
            MenuID=""
            permRoles={{}}
            logcolumns={[]}
            ContainerId=""
            refreshdata={() => {}}
            triggerPopview={() => {}}
            getexceloutparam={() => {}}
            gettableselected={() => {}}
          />
        </div> : null}
      </div>
    )
  }