king
2022-04-26 5046d0d13dc6a8563b8e54e31913bc44cfa1072f
src/views/login/index.jsx
@@ -89,13 +89,6 @@
   * @param {Object} param 用户名密码等信息
   */
  async loginsubmit (param) {
    if (options.sysType === 'local' && !window.GLOB.mainSystemApi) { // 业务系统必须设置单点地址
      Modal.warning({
        title: '未设置单点服务器地址,请联系管理员!'
      })
      return
    }
    let city = sessionStorage.getItem('city') || ''
    let ipAddress = sessionStorage.getItem('ipAddress') || ''
@@ -187,13 +180,6 @@
  }
  async phoneloginsubmit (param) {
    if (options.sysType === 'local' && !window.GLOB.mainSystemApi) { // 业务系统必须设置单点地址
      Modal.warning({
        title: '未设置单点服务器地址,请联系管理员!'
      })
      return
    }
    let city = sessionStorage.getItem('city') || ''
    let ipAddress = sessionStorage.getItem('ipAddress') || ''
@@ -213,9 +199,7 @@
      sessionStorage.setItem('organization', res.organization || '')
      sessionStorage.setItem('localRole_id', res.role_id || '')
      let _url = window.location.href.split('#')[0]
      localStorage.setItem(_url + 'lang', param.lang || 'zh-CN')
      localStorage.setItem(_href + 'lang', param.lang || 'zh-CN')
      sessionStorage.setItem('lang', param.lang || 'zh-CN')
      sessionStorage.removeItem('visitorUserID')
@@ -245,12 +229,6 @@
  }
  authLogin = (appid, openid, memberid, scanId) => {
    if (options.sysType === 'local' && !window.GLOB.mainSystemApi) { // 业务系统必须设置单点地址
      Modal.warning({
        title: '未设置单点服务器地址,请联系管理员!'
      })
      return
    }
    Api.getTouristMsg(appid, openid, memberid, scanId).then(res => {
      if (res.status) {
        sessionStorage.setItem('UserID', res.UserID)
@@ -321,7 +299,28 @@
    //   if (!res || !res.ip) return
    //   sessionStorage.setItem('ipAddress', res.ip)
    // })
    const _addressUrl = window.location.href.split('#')[0] + 'queryAddress'
    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'
    if (localStorage.getItem(_addressUrl) !== 'true') {
      sessionStorage.setItem('city', '')
@@ -331,7 +330,7 @@
    }
    const timeStamp = new Date().getTime()
    const _authUrl = window.location.href.split('#')[0] + 'AuthCode'
    const _authUrl = _href + 'AuthCode'
    let authCode = localStorage.getItem(_authUrl)
    let _s = md5('mksoft' + moment().format('YYYYMMDD'))
@@ -370,12 +369,14 @@
            keys[char] = (offset + i) % 10
          }
  
          let lictime = +key2.replace(/[A-Z]/ig, (s) => {
          let lictime = key2.replace(/[A-Z]/ig, (s) => {
            return keys[s]
          })
          let curtime = +moment().format('YYYYMMDD')
          lictime = lictime.slice(0,4) + '/' + lictime.slice(4,6) + '/' + lictime.slice(6)
          lictime = Math.floor(new Date(lictime).getTime() / 86400000)
          let curtime = Math.floor(new Date().getTime() / 86400000)
          let licday = lictime - curtime
          let _mindUrl = window.location.href.split('#')[0] + 'notMind'
          let _mindUrl = _href + 'notMind'
          if (licday < 0 || isNaN(licday)) {
            Modal.warning({
@@ -527,15 +528,7 @@
            res.indexlogo = res.indexlogo ? res.indexlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
            res.loginlogo = res.loginlogo ? res.loginlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : ''
            if (/^https/.test(window.location.protocol)) { // https转换
              res.Banner = res.Banner ? res.Banner.replace(/^http:/ig, 'https:') : ''
              res.doclogo = res.doclogo ? res.doclogo.replace(/^http:/ig, 'https:') : ''
              res.indexlogo = res.indexlogo ? res.indexlogo.replace(/^http:/ig, 'https:') : ''
              res.loginlogo = res.loginlogo ? res.loginlogo.replace(/^http:/ig, 'https:') : ''
              res.titlelogo = res.titlelogo ? res.titlelogo.replace(/^http:/ig, 'https:') : ''
            }
            let _url = window.location.href.split('#')[0] + 'system'
            let _url = _href + 'system'
            let systemMsg = {
              favicon: res.titlelogo || '',
              platTitle: res.titleName || '',
@@ -559,7 +552,13 @@
              level = ''
            }
            localStorage.setItem(window.location.href.split('#')[0] + 'pwdlevel', level)
            localStorage.setItem(_href + 'pwdlevel', level)
            if (res.srcid) {
              localStorage.setItem(_href + 'srcId', res.srcid)
            } else {
              localStorage.removeItem(_href + 'srcId')
            }
            sessionStorage.setItem('home_background', res.index_background_color || '')
            if (res.sys_datetime) {
@@ -576,7 +575,7 @@
              localStorage.removeItem(_url)
            }
            let _loginurl = window.location.href.split('#')[0] + 'loginways'
            let _loginurl = _href + 'loginways'
            let login_ways = []
            let login_types = []
            if (res.login_ways && res.login_ways.length > 0) {
@@ -670,7 +669,7 @@
      }
    })
    
    let loginWays = localStorage.getItem(window.location.href.split('#')[0] + 'loginways')
    let loginWays = localStorage.getItem(_href + 'loginways')
    if (loginWays) {
      try {
        loginWays = JSON.parse(window.decodeURIComponent(window.atob(loginWays)))