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 (
-
+
);
}
}