king
2021-09-16 d7ec8fbd65cd7225ce8d405a0ee0a1f166f44d7b
src/views/login/index.jsx
@@ -281,25 +281,11 @@
    // })
    const _addressUrl = window.location.href.split('#')[0] + 'queryAddress'
    if (_addressUrl !== 'true') {
    if (localStorage.getItem(_addressUrl) !== 'true') {
      sessionStorage.setItem('city', '')
      sessionStorage.setItem('ipAddress', '')
    } else {
      window.callbackFunction = (res) => {
        if (res.result && res.result.ad_info) {
          sessionStorage.setItem('city', res.result.ad_info.city)
          sessionStorage.setItem('ipAddress', res.result.ip)
        }
      }
      const JSONP = document.createElement('script')
      JSONP.type = 'text/javascript'
      JSONP.src = 'https://apis.map.qq.com/ws/location/v1/ip?callback=callbackFunction&key=BA7BZ-4QB65-LFCIA-QPDA6-4G6O7-MJB4Q&output=jsonp&sig=3e5ebecb324ba266bf80014dcc8380db'
      document.getElementsByTagName('head')[0].appendChild(JSONP)
      setTimeout(() => {
        document.getElementsByTagName('head')[0].removeChild(JSONP)
      },500)
      this.queryAddress()
    }
    const timeStamp = new Date().getTime()
@@ -382,6 +368,7 @@
            localStorage.setItem(_addressUrl, 'false')
          } else {
            localStorage.setItem(_addressUrl, 'true')
            this.queryAddress()
          }
        } else if (res.ErrCode === 'N') {
          localStorage.removeItem(_authUrl)
@@ -563,6 +550,24 @@
    }
  }
  queryAddress = () => {
    window.callbackFunction = (res) => {
      if (res.result && res.result.ad_info) {
        sessionStorage.setItem('city', res.result.ad_info.city)
        sessionStorage.setItem('ipAddress', res.result.ip)
      }
    }
    const JSONP = document.createElement('script')
    JSONP.type = 'text/javascript'
    JSONP.src = 'https://apis.map.qq.com/ws/location/v1/ip?callback=callbackFunction&key=BA7BZ-4QB65-LFCIA-QPDA6-4G6O7-MJB4Q&output=jsonp&sig=3e5ebecb324ba266bf80014dcc8380db'
    document.getElementsByTagName('head')[0].appendChild(JSONP)
    setTimeout(() => {
      document.getElementsByTagName('head')[0].removeChild(JSONP)
    },500)
  }
  syncSubmit = () => {
    this.setState({
      syncing: true