king
2020-08-28 71a0e75ecb56ae643fe1e86188d45f93f48388c9
src/views/login/index.jsx
@@ -17,6 +17,12 @@
const LoginCloudForm = asyncLoadComponent(() => import('./logincloudform'))
const iszhCN = localStorage.getItem('lang') !== 'en-US'
const _href = window.location.href.split('#')[0]
if (localStorage.getItem(_href + 'paramsmain')) {
  sessionStorage.setItem('history', localStorage.getItem(_href + 'paramsmain'))
  localStorage.removeItem(_href + 'paramsmain')
}
class Login extends Component {
  state = {
    selectedlang: iszhCN ? 'zh-CN' : 'en-US',
@@ -91,9 +97,16 @@
        localStorage.removeItem(_url)
      }
      if (this.props.location.state && this.props.location.state.from.pathname) {
      // if (this.props.location.state && this.props.location.state.from.pathname) {
      //   // 查看是否为其他页面跳转,路径存在时,跳回原页面
      //   this.props.history.replace(this.props.location.state.from.pathname)
      // }
      let _history = sessionStorage.getItem('history')
      if (_history) {
        sessionStorage.removeItem('history')
        // 查看是否为其他页面跳转,路径存在时,跳回原页面
        this.props.history.replace(this.props.location.state.from.pathname)
        this.props.history.replace(_history)
      } else {
        this.props.history.replace('/main')
      }
@@ -131,9 +144,11 @@
      localStorage.setItem('lang', param.lang || 'zh-CN')
      if (this.props.location.state && this.props.location.state.from.pathname) {
      let _history = sessionStorage.getItem('history')
      if (_history) {
        sessionStorage.removeItem('history')
        // 查看是否为其他页面跳转,路径存在时,跳回原页面
        this.props.history.replace(this.props.location.state.from.pathname)
        this.props.history.replace(_history)
      } else {
        this.props.history.replace('/main')
      }
@@ -296,6 +311,11 @@
            })
            window.GLOB.mainlogo = systemMsg.mainlogo
            window.GLOB.style = systemMsg.style
            if (window.GLOB.style && options.styles[window.GLOB.style]) {
              document.getElementById('root').className = options.styles[window.GLOB.style]
            }
            if (res.titlelogo && window.GLOB.favicon !== res.titlelogo) {
              let link = document.querySelector("link[rel*='icon']") || document.createElement('link')