| | |
| | | visible: false, |
| | | loading: false, |
| | | type: 'account', |
| | | okText: '确定', |
| | | okText: window.GLOB.dict['ok'] || '确定', |
| | | dict: window.GLOB.dict, |
| | | smsId: '', |
| | | mob: '', |
| | | code: '' |
| | |
| | | visible: true, |
| | | loading: false, |
| | | type: 'account', |
| | | okText: '确定', |
| | | okText: window.GLOB.dict['ok'] || '确定', |
| | | mob: '', |
| | | code: '', |
| | | smsId: sessionStorage.getItem('mk_sms_id') || '' |
| | |
| | | } |
| | | |
| | | resetPwdSubmit = () => { |
| | | const { type } = this.state |
| | | const { type, dict } = this.state |
| | | |
| | | if (type === 'account') { |
| | | this.formRef.handleConfirm().then(res => { |
| | |
| | | }) |
| | | notification.success({ |
| | | top: 92, |
| | | message: '修改成功,请重新登录。', |
| | | message: dict['re_login'] || '修改成功,请重新登录。', |
| | | duration: 2 |
| | | }) |
| | | this.callback && this.callback() |
| | |
| | | if (!/^1[3456789]\d{9}$/.test(res.phone)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '手机号格式错误,请重填!', |
| | | message: dict['phone_error'] || '手机号格式错误,请重填!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | this.setState({ |
| | | code: res.vercode, |
| | | type: 'phonepwd', |
| | | okText: '确定' |
| | | okText: dict['ok'] || '确定' |
| | | }) |
| | | }, () => {}) |
| | | } else if (type === 'phonepwd') { |
| | |
| | | }) |
| | | notification.success({ |
| | | top: 92, |
| | | message: '修改成功,请重新登录。', |
| | | message: dict['re_login'] || '修改成功,请重新登录。', |
| | | duration: 2 |
| | | }) |
| | | this.callback && this.callback() |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { visible, loading, okText, type, mob, smsId } = this.state |
| | | const { visible, loading, okText, type, mob, smsId, dict } = this.state |
| | | |
| | | return ( |
| | | <Modal |
| | | title="修改密码" |
| | | title={dict['ch_pwd'] || '修改密码'} |
| | | wrapClassName="reset-password-modal" |
| | | visible={visible} |
| | | maskClosable={false} |
| | | onOk={this.resetPwdSubmit} |
| | | onCancel={() => { this.setState({ visible: false })}} |
| | | okText={okText} |
| | | cancelText="取消" |
| | | cancelText={dict['cancel'] || '取消'} |
| | | confirmLoading={loading} |
| | | destroyOnClose |
| | | > |
| | | <Resetpwd type={type} mob={mob} smsId={smsId} wrappedComponentRef={(inst) => this.formRef = inst} resetPwdSubmit={this.resetPwdSubmit}/> |
| | | {type === 'account' && smsId ? <div className="forget-pwd"><span onClick={() => this.setState({type: 'mob', okText: '下一步'})}>忘记密码?</span></div> : null} |
| | | {type === 'account' && smsId ? <div className="forget-pwd"><span onClick={() => this.setState({type: 'mob', okText: dict['next'] || '下一步'})}>{dict['forgot_pwd'] || '忘记密码?'}</span></div> : null} |
| | | </Modal> |
| | | ) |
| | | } |