From f3d4db769ba9b51b799d981511a710fd443d0e08 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 21 四月 2025 12:18:03 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/components/resetPassword/resetpwd/index.jsx | 82 ++++++++++++++++++++++++++-------------- 1 files changed, 53 insertions(+), 29 deletions(-) diff --git a/src/components/resetPassword/resetpwd/index.jsx b/src/components/resetPassword/resetpwd/index.jsx index ee7a60a..829571b 100644 --- a/src/components/resetPassword/resetpwd/index.jsx +++ b/src/components/resetPassword/resetpwd/index.jsx @@ -9,7 +9,8 @@ state = { confirmDirty: false, autoCompleteResult: [], - level: localStorage.getItem(window.location.href.split('#')[0] + 'pwdlevel') || '' + level: localStorage.getItem(window.GLOB.sysSign + 'pwdlevel') || '', + dict: window.GLOB.dict, } LoginTimer = null @@ -63,7 +64,7 @@ compareToFirstPassword = (rule, value, callback) => { const { form } = this.props if (value && value !== form.getFieldValue('password')) { - callback('涓ゆ杈撳叆瀵嗙爜涓嶄竴鑷达紒') + callback(window.GLOB.dict['pwd_notM'] || '涓ゆ杈撳叆瀵嗙爜涓嶄竴鑷达紒') } else { callback() } @@ -71,16 +72,16 @@ validateToNextPassword = (rule, value, callback) => { const { form } = this.props - const { level } = this.state + const { level, dict } = this.state if (value && this.state.confirmDirty) { form.validateFields(['confirm'], { force: true }) } if (level === 'letter_num' && value && /^[0-9a-zA-Z!@#$%^&*()_]*$/.test(value) && /^([^0-9]*|[^a-zA-Z]*)$/.test(value)) { - callback('瀵嗙爜涓繀椤诲惈鏈夋暟瀛楀拰瀛楁瘝銆�') + callback(dict['pwd_letter_num'] || '瀵嗙爜涓繀椤诲寘鍚暟瀛椾笌瀛楁瘝') } else if ((level === 'char_num' || level === 'char_num_90' || level === 'char_num_90_sms') && value && /^[0-9a-zA-Z!@#$%^&*()_]*$/.test(value) && /^([^0-9]*|[^a-zA-Z]*|[^!@#$%^&*()_]*)$/.test(value)) { - callback('瀵嗙爜涓繀椤诲惈鏈夋暟瀛椼�佸瓧姣嶅拰鐗规畩瀛楃銆�') + callback(dict['pwd_char_num'] || '瀵嗙爜涓繀椤诲惈鏈夋暟瀛椼�佸瓧姣嶄互鍙婄壒娈婂瓧绗�') } else { callback() } @@ -142,7 +143,30 @@ }) message.warning(res.message) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') { + let param = { + func: 's_visitor_login', + timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), + SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk', + TypeCharOne: 'pc', + appkey: '202004041613277377A6A2456D34A4948AE84' + } + + param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp)) + param.secretkey = md5(param.LText + 'mingke' + param.timestamp) + + let params = { + url: 'https://sso.mk9h.cn/webapi/dologon', + method: 'post', + data: JSON.stringify(param) + } + + Api.directRequest(params) + + return + } + clearTimeout(this.LoginTimer) this.setState({ verdisabled: false, @@ -168,12 +192,12 @@ render() { const { type } = this.props const { getFieldDecorator } = this.props.form - const { level, delay, verdisabled } = this.state + const { level, delay, verdisabled, dict } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, - sm: { span: 6 } + sm: { span: 7 } }, wrapperCol: { xs: { span: 24 }, @@ -185,38 +209,38 @@ if (level) { rules.push({ min: 8, - message: '瀵嗙爜闀垮害涓嶅彲灏忎簬8浣嶏紒' + message: dict['pwd_min'] || '瀵嗙爜闀垮害涓嶅彲灏忎簬8浣�' }) } return ( <> {type === 'account' ? <Form {...formItemLayout} onKeyDown={this.onEnterSubmit} id="reset-password-form"> - <Form.Item label="鍘熷瘑鐮�"> + <Form.Item label={dict['ori_pwd'] || '鍘熷瘑鐮�'}> {getFieldDecorator('originpwd', { rules: [ { required: true, - message: '璇疯緭鍏ュ師瀵嗙爜锛�' + message: dict['oripwd_required'] || '璇疯緭鍏ュ師瀵嗙爜锛�' } ] })(<Input.Password autoFocus/>)} </Form.Item> - <Form.Item label="鏂板瘑鐮�" hasFeedback> + <Form.Item label={dict['new_pwd'] || '鏂板瘑鐮�'} hasFeedback> {getFieldDecorator('password', { rules: [ { required: true, - message: '璇疯緭鍏ユ柊瀵嗙爜锛�' + message: dict['newpwd_required'] || '璇疯緭鍏ユ柊瀵嗙爜锛�' }, { pattern: /^[0-9a-zA-Z!@#$%^&*()_]*$/ig, - message: '瀵嗙爜鍙厑璁稿寘鍚暟瀛椼�佸瓧姣嶄互鍙�!@#$%&*()_銆�' + message: dict['password_format'] || '瀵嗙爜鍙厑璁稿寘鍚暟瀛椼�佸瓧姣嶄互鍙�!@#$%&*()_銆�' }, ...rules, { max: 50, - message: '鏈�澶у瘑鐮侀暱搴︿负50浣嶏紒' + message: dict['pwd_max'] || '瀵嗙爜闀垮害涓嶅彲瓒呰繃50涓瓧绗︼紒' }, { validator: this.validateToNextPassword @@ -224,12 +248,12 @@ ] })(<Input.Password />)} </Form.Item> - <Form.Item label="纭瀵嗙爜" hasFeedback> + <Form.Item label={dict['con_pwd'] || '纭瀵嗙爜'} hasFeedback> {getFieldDecorator('confirm', { rules: [ { required: true, - message: '璇风‘璁ゅ瘑鐮侊紒' + message: dict['conpwd_required'] || '璇风‘璁ゅ瘑鐮侊紒' }, { validator: this.compareToFirstPassword @@ -239,21 +263,21 @@ </Form.Item> </Form> : null} {type === 'phonepwd' ? <Form {...formItemLayout} onKeyDown={(e) => e.key === 'Enter' && this.props.resetPwdSubmit()}> - <Form.Item label="鏂板瘑鐮�" hasFeedback> + <Form.Item label={dict['new_pwd'] || '鏂板瘑鐮�'} hasFeedback> {getFieldDecorator('password', { rules: [ { required: true, - message: '璇疯緭鍏ユ柊瀵嗙爜锛�' + message: dict['newpwd_required'] || '璇疯緭鍏ユ柊瀵嗙爜锛�' }, { pattern: /^[0-9a-zA-Z!@#$%^&*()_]*$/ig, - message: '瀵嗙爜鍙厑璁稿寘鍚暟瀛椼�佸瓧姣嶄互鍙�!@#$%&*()_銆�' + message: dict['password_format'] || '瀵嗙爜鍙厑璁稿寘鍚暟瀛椼�佸瓧姣嶄互鍙�!@#$%&*()_銆�' }, ...rules, { max: 50, - message: '鏈�澶у瘑鐮侀暱搴︿负50浣嶏紒' + message: dict['pwd_max'] || '瀵嗙爜闀垮害涓嶅彲瓒呰繃50涓瓧绗︼紒' }, { validator: this.validateToNextPassword @@ -261,12 +285,12 @@ ] })(<Input.Password />)} </Form.Item> - <Form.Item label="纭瀵嗙爜" hasFeedback> + <Form.Item label={dict['con_pwd'] || '纭瀵嗙爜'} hasFeedback> {getFieldDecorator('confirm', { rules: [ { required: true, - message: '璇风‘璁ゅ瘑鐮侊紒' + message: dict['conpwd_required'] || '璇风‘璁ゅ瘑鐮侊紒' }, { validator: this.compareToFirstPassword @@ -276,16 +300,16 @@ </Form.Item> </Form> : null} {type === 'mob' ? <Form {...formItemLayout} onKeyDown={(e) => e.key === 'Enter' && this.props.resetPwdSubmit()}> - <Form.Item label="鎵嬫満鍙�"> + <Form.Item label={dict['phone_no'] || '鎵嬫満鍙�'}> {getFieldDecorator('phone', { initialValue: '', rules: [ { required: true, - message: '璇疯緭鍏ユ墜鏈哄彿锛�' + message: dict['phone_no_required'] || '璇疯緭鍏ユ墜鏈哄彿' } ] - })(<Input placeholder="璇疯緭鍏ユ墜鏈哄彿" autoComplete="off" />)} + })(<Input placeholder={dict['phone_no'] || '鎵嬫満鍙�'} autoComplete="off" />)} </Form.Item> </Form> : null} {type === 'code' ? <Form wrapperCol={{ xs: { span: 24 }, sm: { span: 20 }}} onKeyDown={(e) => e.key === 'Enter' && this.props.resetPwdSubmit()}> @@ -295,16 +319,16 @@ rules: [ { required: true, - message: '璇疯緭鍏ラ獙璇佺爜锛�' + message: dict['vercode_required'] || '璇疯緭鍏ラ獙璇佺爜' } ] })(<Input addonAfter={ <Button type="link" size="small" disabled={verdisabled} onClick={this.getvercode}> - {delay ? `${delay}s鍚庨噸鏂拌幏鍙朻 : '鑾峰彇楠岃瘉鐮�'} + {delay ? `${delay}s` : dict['query_vercode'] || '鑾峰彇楠岃瘉鐮�'} </Button> } - placeholder="璇疯緭鍏ラ獙璇佺爜" + placeholder={dict['vercode'] || '楠岃瘉鐮�'} autoComplete="off" />)} </Form.Item> -- Gitblit v1.8.0