From 505ed1181c5c341ea24de8417f3909009ac68dfa Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 17 六月 2024 16:56:44 +0800 Subject: [PATCH] 2024-06-17 --- src/views/login/index.jsx | 33 +++++++++++++++++++++------------ 1 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index 711501d..1dc310a 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -7,8 +7,6 @@ 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' @@ -23,7 +21,6 @@ class Login extends Component { state = { selectedlang: iszhCN ? 'zh-CN' : 'en-US', - dict: iszhCN ? zhCN : enUS, isDisabled: false, auth: false, authError: '', @@ -616,7 +613,7 @@ 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 || '', @@ -670,16 +667,31 @@ 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, @@ -900,7 +912,6 @@ </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} @@ -923,9 +934,7 @@ </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} -- Gitblit v1.8.0