king
2021-08-13 a13b2a8d6e84662275ea913850e01be9b2ff31e5
src/views/login/index.jsx
@@ -198,15 +198,17 @@
  componentDidMount () {
    // 获取ip及城市信息
    let ipurl = window.atob('aHR0cHM6Ly9lcGMubWs5a$mkC5jbi93ZWJhcGkvaXBsb2M='.replace(/\$mk/ig, ''))
    Api.directRequest(ipurl, 'get', null, 'true').then(res => {
      if (!res || !res.location) return
      sessionStorage.setItem('city', res.location)
      this.setState({
        ipAddress: res.ip || '',
        city: res.location
      })
    })
    // 获取地理位置:谷歌无效,谷歌定位需要将附近的无线信息发送到谷歌的服务器,查询定位信息,国内无法连接到谷歌服务器,火狐可以获取经纬度
    // let ipurl = window.atob('aHR0cHM6Ly9lcGMubWs5a$mkC5jbi93ZWJhcGkvaXBsb2M='.replace(/\$mk/ig, ''))
    // Api.directRequest(ipurl, 'get', null, 'true').then(res => {
    //   if (!res || !res.location) return
    //   sessionStorage.setItem('city', res.location)
    //   this.setState({
    //     ipAddress: res.ip || '',
    //     city: res.location
    //   })
    // })
    sessionStorage.setItem('city', '') // ip地址定位暂停使用
    const timeStamp = new Date().getTime()
    const _authUrl = window.location.href.split('#')[0] + 'AuthCode'
@@ -215,13 +217,15 @@
    authCode = authCode ? authCode.split(',') : []
    let index = authCode.findIndex(key => key === _s)
    if (index > -1) {
    let key = md5(window.GLOB.appId + 'minke_software' + window.GLOB.appkey).toUpperCase().substr(-6)
    if (index > -1 || window.GLOB.licenseKey === key) {
      this.setState({
        auth: true
      })
    }
    if (index === -1 || index > 5) {
    if (window.GLOB.licenseKey !== key && (index === -1 || index > 5)) {
      let _appId = window.GLOB.appId
  
      if (options.sysType === 'cloud') { // 云端使用系统配置appid