From 38ba12e9e663735dc076e6a9f201954de841cafd Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 29 Apr 2025 10:19:41 +0800 Subject: [PATCH] =?UTF-8?q?custom-=E8=81=94=E7=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/mobilePayroll/secondarypwdModify.js | 36 ++++--------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdModify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdModify.js index 230e3092..96c8c40b 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdModify.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdModify.js @@ -21,13 +21,6 @@ const form = new WeaForm(); const getLabel = WeaLocaleProvider.getLabel; class SecondarypwdModify extends Component { - constructor(props) { - super(props); - this.state = { - src: (window.ecologyContentPath || "") + "/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4", - num: 0 - }; - } componentDidMount() { form.initFormFields(secondarypwdCondition); @@ -40,22 +33,19 @@ class SecondarypwdModify extends Component { save = async () => { form.validateForm().then(f => { if (f.isValid) { - const { secondaryPwd1: newSecondaryPwd1, secondaryPwd2: newSecondaryPwd2, validatecode } = form.getFormParams(); + const { secondaryPwd1: newSecondaryPwd1, secondaryPwd2: newSecondaryPwd2 } = form.getFormParams(); if (newSecondaryPwd1 !== newSecondaryPwd1) { form.showError("secondaryPwd2", getLabel(504376, "密码确认不正确!")); return; } RSAEcrypt("1", { newSecondaryPwd1, newSecondaryPwd2 }).then(RSAParam => { - API.modifySecondaryPwd({ ...RSAParam, validatecode }, this.props.salaryBillToken) + API.modifySecondaryPwd({ ...RSAParam }, this.props.salaryBillToken) .then(({ sign, message: msg }) => { if (sign === "1") { message.success(msg); this.props.onSuccess(); } else { - form.showError("validatecode", msg); - this.setState({ num: this.state.num + 1 }, () => { - this.setState({ src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}` }); - }); + form.showError("secondaryPwd2", msg); } }); }); @@ -65,9 +55,10 @@ class SecondarypwdModify extends Component { }); }; handleChangeForm = () => { + form.updateFields({ validatecode: "123" }); RSAEcrypt("1", { newSecondaryPwd1: form.getFormParams().secondaryPwd1 }).then(RSAParam => { API.checkNewSecondaryPwd({ ...RSAParam }).then(({ result }) => { - if (!result) form.showError("secondaryPwd2", getLabel(111, "二次验证密码不能和登录密码相同!")); + if (!result) form.showError("secondaryPwd1", getLabel(111, "二次验证密码不能和登录密码相同!")); }); }); }; @@ -81,23 +72,10 @@ class SecondarypwdModify extends Component { onBlur={this.handleChangeForm}/> ); }, - validatecode: (field, textAreaProps, form, formParams) => { - return ( - - { - this.setState({ num: this.state.num + 1 }, () => { - this.setState({ src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}` }); - }); - }} alt=""/> - ); - } + validatecode: () => null }; return ( - + ); } }