king
2023-09-07 4b467effbc0e3a9199146573c0ceedf404bd07c5
src/views/login/index.jsx
@@ -536,20 +536,20 @@
    Api.getTouristMsg().then(result => {
      if (result.status) {
        if (result.website && process.env.NODE_ENV === 'production') {
          let website = result.website.replace(/http(s)?:\/\/|\/$/ig, '').toLowerCase()
          let current = window.GLOB.baseurl.replace(/http(s)?:\/\/|\/$/ig, '').toLowerCase()
        // if (result.website && process.env.NODE_ENV === 'production') {
        //   let website = result.website.replace(/http(s)?:\/\/|\/$/ig, '').toLowerCase()
        //   let current = window.GLOB.baseurl.replace(/http(s)?:\/\/|\/$/ig, '').toLowerCase()
          if (website !== current) {
            try {
              window.history.replaceState(null, null, result.website.replace(/\/$/ig, '') + '/admin/index.html#/login')
              window.location.reload()
            } catch(e) {
              window.location.href = result.website.replace(/\/$/ig, '') + '/admin/index.html#/login'
            }
            return
          }
        }
        //   if (website !== current) {
        //     try {
        //       window.history.replaceState(null, null, result.website.replace(/\/$/ig, '') + '/admin/index.html#/login')
        //       window.location.reload()
        //     } catch(e) {
        //       window.location.href = result.website.replace(/\/$/ig, '') + '/admin/index.html#/login'
        //     }
        //     return
        //   }
        // }
        
        sessionStorage.setItem('visitorUserID', result.UserID || '')
        sessionStorage.setItem('visitorLoginUID', result.LoginUID || '')