king
2021-03-12 e2a0980e4a701a3dd07c339ff24ec4221dbed2dd
src/views/login/index.jsx
@@ -6,7 +6,7 @@
import Api from '@/api'
import Utils from '@/utils/utils.js' 
import options from '@/store/options.js'
import options, { styles } from '@/store/options.js'
import zhCN from '@/locales/zh-CN/login.js'
import enUS from '@/locales/en-US/login.js'
import asyncLoadComponent from '@/utils/asyncLoadComponent'
@@ -15,7 +15,7 @@
const LoginForm = asyncLoadComponent(() => import('./loginform'))
const LoginCloudForm = asyncLoadComponent(() => import('./logincloudform'))
const iszhCN = localStorage.getItem('lang') !== 'en-US'
const iszhCN = sessionStorage.getItem('lang') !== 'en-US'
const _href = window.location.href.split('#')[0]
if (localStorage.getItem(_href + 'paramsmain')) {
@@ -95,11 +95,12 @@
      sessionStorage.setItem('debug', res.debug || '')
      sessionStorage.setItem('role_id', res.role_id || '')
      sessionStorage.setItem('localRole_id', res.role_id || '')
      localStorage.setItem('lang', param.lang || 'zh-CN')
      let _url = window.location.href.split('#')[0]
      localStorage.setItem(_url + 'lang', param.lang || 'zh-CN')
      sessionStorage.setItem('lang', param.lang || 'zh-CN')
      if (param.remember) { // 记住密码时账号密码存入localStorage
        localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify({username: param.username, password: param.password}))))
      } else {
@@ -162,7 +163,10 @@
      sessionStorage.setItem('role_id', res.role_id || '')
      sessionStorage.setItem('localRole_id', res.role_id || '')
      localStorage.setItem('lang', param.lang || 'zh-CN')
      let _url = window.location.href.split('#')[0]
      localStorage.setItem(_url + 'lang', param.lang || 'zh-CN')
      sessionStorage.setItem('lang', param.lang || 'zh-CN')
      let _history = sessionStorage.getItem('history')
      if (_history) {
@@ -255,8 +259,12 @@
    Api.getTouristMsg().then(result => {
      if (result.status) {
        result.UserID && sessionStorage.setItem('UserID', result.UserID)
        result.LoginUID && sessionStorage.setItem('LoginUID', result.LoginUID)
        if (result.UserID && !sessionStorage.getItem('UserID')) {
          sessionStorage.setItem('UserID', result.UserID)
        }
        if (result.LoginUID && !sessionStorage.getItem('LoginUID')) {
          sessionStorage.setItem('LoginUID', result.LoginUID)
        }
        if (result.UserID && result.LoginUID) {
          this.setState({touristLogin: true})
@@ -286,7 +294,9 @@
              mainlogo: res.indexlogo || '',
              doclogo: res.doclogo || '',
              style: res.CSS || '',
              webSite: res.WebSite || ''
              showline: res.split_line_show || 'true',
              webSite: res.WebSite || '',
              navBar: res.menu_type
            }
            sessionStorage.setItem('home_background', res.index_background_color)
@@ -339,9 +349,10 @@
            window.GLOB.mainlogo = systemMsg.mainlogo
            window.GLOB.style = systemMsg.style
            window.GLOB.navBar = systemMsg.navBar
        
            if (window.GLOB.style && options.styles[window.GLOB.style]) {
              document.getElementById('root').className = options.styles[window.GLOB.style]
            if (window.GLOB.style && styles[window.GLOB.style]) {
              document.body.className = styles[window.GLOB.style] + ' ' + (res.split_line_show === 'false' ? 'hidden-split-line' : '')
            }
            if (res.titlelogo && window.GLOB.favicon !== res.titlelogo) {
@@ -357,6 +368,16 @@
            if (typeof(memberLevel) === 'number' && memberLevel > 10 && parseInt(memberLevel / 10) * 10 === memberLevel) {
              sessionStorage.setItem('Member_Level', md5('mksoft' + moment().format('YYYYMM') + memberLevel))
              this.props.modifyMemberLevel(memberLevel)
            }
            if (res.users_upt === 'true' && window.GLOB.systemType === 'production') {
              Api.getLocalConfig ({func: 's_Get_local_u_deleted', users_upt_date: res.users_upt_date}).then(localres => {
                if (!localres.status) return
                Api.getSystemConfig({func: 's_get_sso_u_create', user_ids: localres.user_ids, user_ids_local: localres.user_ids_local, users_upt_date: localres.users_upt_date}).then(ssores => {
                  if (!ssores.status) return
                  Api.getLocalConfig ({func: 's_get_local_u_create', user_ids_local: ssores.user_ids_local})
                })
              })
            }
          } else {
            message.warning(res.message)
@@ -483,7 +504,7 @@
        </div>
        <div className="login-bottom">
          {webSite && copyRight ?
            <a target="blank" href={webSite} dangerouslySetInnerHTML={{ __html: copyRight.replace(/\s/ig, '&nbsp;') }}></a> :
            <a target="_blank" rel="noopener noreferrer" href={webSite} dangerouslySetInnerHTML={{ __html: copyRight.replace(/\s/ig, '&nbsp;') }}></a> :
            <p dangerouslySetInnerHTML={{ __html: copyRight ? copyRight.replace(/\s/ig, '&nbsp;') : '' }}></p>
          }
          {ICP ? <p dangerouslySetInnerHTML={{ __html: ICP.replace(/\s/ig, '&nbsp;') }}></p> : null}
@@ -495,6 +516,7 @@
          cancelText={this.state.dict['login.auth.cancel']}
          visible={this.state.syncApp}
          onOk={this.syncSubmit}
          maskClosable={false}
          className="sync-cloud-application"
          width={'430px'}
          confirmLoading={this.state.syncing}