| | |
| | | import Utils from '@/utils/utils.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import { styles } from '@/store/options.js' |
| | | import zhCN from '@/locales/zh-CN/login.js' |
| | | import enUS from '@/locales/en-US/login.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncLoadComponent from '@/utils/asyncLoadComponent' |
| | | import './index.scss' |
| | |
| | | class Login extends Component { |
| | | state = { |
| | | selectedlang: iszhCN ? 'zh-CN' : 'en-US', |
| | | dict: iszhCN ? zhCN : enUS, |
| | | isDisabled: false, |
| | | auth: false, |
| | | authError: '', |
| | |
| | | platName: res.SysName || '', |
| | | bgImage: res.Banner || '', |
| | | loginlogo: res.loginlogo || '', |
| | | copyRight: res.CopyRightYear && res.CopyRightOrg ? `Copyright©${res.CopyRightYear} 所有相关版权归 ${res.CopyRightOrg}` : '', |
| | | copyRight: res.CopyRightYear && res.CopyRightOrg ? `Copyright©${res.CopyRightYear} ${window.GLOB.dict['copyrights_by'] || '所有相关版权归'} ${res.CopyRightOrg}` : '', |
| | | ICP: res.ICP || '', |
| | | mainlogo: res.indexlogo || '', |
| | | doclogo: res.doclogo || '', |
| | |
| | | localStorage.removeItem(_url) |
| | | } |
| | | |
| | | |
| | | if (res.lang_translation_js && res.lang_data && res.lang_data[0] && (res.lang_data.length > 1 || res.lang_data[0].Lang !== 'zh-CN')) { |
| | | let lang = sessionStorage.getItem('lang') |
| | | let js_trans = res.lang_translation_js.map(item => { |
| | | if (lang === item.lang) { |
| | | window.GLOB.dict[item.msn_code] = item.translation |
| | | } |
| | | |
| | | return { |
| | | lang: item.lang, |
| | | key: item.msn_code, |
| | | val: item.translation |
| | | } |
| | | }) |
| | | |
| | | localStorage.setItem(_href + 'js_trans', JSON.stringify(js_trans)) |
| | | } |
| | | |
| | | let _loginurl = _href + 'loginways' |
| | | let login_ways = [] |
| | | let login_types = [] |
| | | if (res.login_ways && res.login_ways.length > 0) { |
| | | res.login_ways.forEach(item => { |
| | | // 短信验证码登录,必须设置短信Id |
| | | if (item.way_no === 'sms_vcode' && !item.sms_id) return |
| | | if (login_types.includes(item.way_no)) return |
| | | |
| | | login_types.push(item.way_no) |
| | | if (!['sms_vcode', 'uname_pwd', 'app_scan', 'weixin_scan'].includes(item.way_no)) return |
| | | |
| | | login_ways.push({ |
| | | type: item.way_no, |
| | |
| | | </div> |
| | | <div className="login-middle" style={lineColor ? {borderColor: lineColor} : {}}> |
| | | {loginWays ? <LoginForm |
| | | dict={this.state.dict} |
| | | auth={this.state.auth} |
| | | authError={this.state.authError} |
| | | touristLogin={touristLogin} |
| | |
| | | </div> |
| | | {/* 编辑状态登录 */} |
| | | <Modal |
| | | title={this.state.dict['login.sync.cloud']} |
| | | okText={this.state.dict['login.ok']} |
| | | cancelText={this.state.dict['login.cancel']} |
| | | title="同步云端应用" |
| | | visible={this.state.syncApp} |
| | | onOk={this.syncSubmit} |
| | | maskClosable={false} |