king
2023-06-30 0519dcda8b6fb2914987f8d4d58e1d14bcf98dc3
src/views/login/index.jsx
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { message, Modal, notification } from 'antd'
import { message, Modal } from 'antd'
import md5 from 'md5'
import moment from 'moment'
@@ -149,7 +149,13 @@
        }
      }
      this.props.history.replace('/main')
      let iframe = sessionStorage.getItem('iframe')
      if (iframe) {
        sessionStorage.removeItem('iframe')
        this.props.history.replace(iframe.replace(/@loginuid@/, res.LoginUID))
      } else {
        this.props.history.replace('/main')
      }
    } else if (res.ErrCode === 'Need_Get_Appkey' && options.sysType === 'SSO') {
      message.warning('应用尚未创建,请向云端同步应用!')
@@ -203,7 +209,13 @@
      sessionStorage.removeItem('visitorUserID')
      sessionStorage.removeItem('visitorLoginUID')
      this.props.history.replace('/main')
      let iframe = sessionStorage.getItem('iframe')
      if (iframe) {
        sessionStorage.removeItem('iframe')
        this.props.history.replace(iframe.replace(/@loginuid@/, res.LoginUID))
      } else {
        this.props.history.replace('/main')
      }
    } else if (res.ErrCode === 'Need_Get_Appkey' && options.sysType === 'SSO') {
      message.warning('应用尚未创建,请向云端同步应用!')
@@ -242,7 +254,13 @@
        sessionStorage.removeItem('visitorUserID')
        sessionStorage.removeItem('visitorLoginUID')
  
        this.props.history.replace('/main')
        let iframe = sessionStorage.getItem('iframe')
        if (iframe) {
          sessionStorage.removeItem('iframe')
          this.props.history.replace(iframe.replace(/@loginuid@/, res.LoginUID))
        } else {
          this.props.history.replace('/main')
        }
      } else if (res.ErrCode === 'Need_Get_Appkey' && options.sysType === 'SSO') {
        message.warning('应用尚未创建,请向云端同步应用!')
  
@@ -291,27 +309,6 @@
      if (view) {
        view.style.filter = 'grayscale(100%)'
      }
    }
    if (sessionStorage.getItem('loginError')) {
      try {
        let res = JSON.parse(sessionStorage.getItem('loginError'))
        console.info(res.url)
        console.info(res.request)
        console.info(res.response)
        let result = JSON.parse(res.response)
        notification.warning({
          top: 92,
          message: result.message,
          duration: 5
        })
      } catch (e) {}
      setTimeout(() => {
        sessionStorage.removeItem('loginError')
      }, 2000)
    }
    const _addressUrl = _href + 'queryAddress'
@@ -449,7 +446,7 @@
      Api.directRequest({
        url: _rduri + '/' + _func,
        method: 'post',
        data: param
        data: JSON.stringify(param)
      }).then(res => {
        if (res.status) {
          if (res.EPC === str) {
@@ -491,7 +488,30 @@
            authError: res.message
          })
        }
      }, () => {
      }, (error) => {
        if (error && error.ErrCode === 'LoginError') {
          let param = {
            func: 's_visitor_login',
            timestamp: moment().format('YYYY-MM-DD HH:mm:ss'),
            SessionUid: _id,
            TypeCharOne: 'pc',
            appkey: '202004041613277377A6A2456D34A4948AE84'
          }
          param.LText = md5(window.btoa(_id + param.timestamp))
          param.secretkey = md5(param.LText + 'mingke' + param.timestamp)
          let params = {
            url: _rduri.replace('dostars', 'dologon'),
            method: 'post',
            data: JSON.stringify(param)
          }
          Api.directRequest(params)
          return
        }
        if (index === -1 || index > 10) {
          this.setState({
            auth: false,
@@ -538,6 +558,8 @@
        _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp)
        Api.getSystemConfig(_param).then(res => {
          if (!res) return
          if (res.status) {
            // positecgroup
            // res.Banner = res.Banner ? res.Banner.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''