custom-联特

This commit is contained in:
lys 2025-04-28 16:13:51 +08:00
parent 90f45a3c7b
commit b99b178f61
2 changed files with 21 additions and 3 deletions

View File

@ -49,6 +49,10 @@ export const checkPassword = (params, headers) => {
return formHeaderPost("/api/hrm/secondarypwd/checkPassword", "POST", params, headers);
// return WeaTools.callApi("/api/hrm/secondarypwd/checkPassword", "POST", params);
};
export const checkNewSecondaryPwd = (params, headers) => {
return formHeaderPost("/api/hrm/secondarypwd/checkNewSecondaryPwd", "POST", params, headers);
// return WeaTools.callApi("/api/hrm/secondarypwd/checkNewSecondaryPwd", "POST", params);
};
export const saveSecondaryPwd = (params, headers) => {
return formHeaderPost("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params, headers);
// return WeaTools.callApi("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params);

View File

@ -40,12 +40,12 @@ class SecondarypwdModify extends Component {
save = async () => {
form.validateForm().then(f => {
if (f.isValid) {
const { secondaryPwd1, secondaryPwd2, validatecode } = form.getFormParams();
if (secondaryPwd1 !== secondaryPwd2) {
const { secondaryPwd1: newSecondaryPwd1, secondaryPwd2: newSecondaryPwd2, validatecode } = form.getFormParams();
if (newSecondaryPwd1 !== newSecondaryPwd1) {
form.showError("secondaryPwd2", getLabel(504376, "密码确认不正确!"));
return;
}
RSAEcrypt("1", { secondaryPwd1, secondaryPwd2 }).then(RSAParam => {
RSAEcrypt("1", { newSecondaryPwd1, newSecondaryPwd2 }).then(RSAParam => {
API.saveSecondaryPwd({ ...RSAParam, validatecode }, this.props.salaryBillToken)
.then(({ sign, message: msg }) => {
if (sign === "1") {
@ -64,9 +64,23 @@ class SecondarypwdModify extends Component {
}
});
};
handleChangeForm = () => {
RSAEcrypt("1", { newSecondaryPwd1: form.getFormParams().secondaryPwd1 }).then(RSAParam => {
API.checkNewSecondaryPwd({ ...RSAParam }).then(({ result }) => {
if (!result) form.showError("secondaryPwd2", getLabel(111, "二次验证密码不能和登录密码相同!"));
});
});
};
render() {
const itemRender = {
secondaryPwd1: (field, textAreaProps, form, formParams) => {
return (<React.Fragment>
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}
onBlur={this.handleChangeForm}/>
</React.Fragment>);
},
validatecode: (field, textAreaProps, form, formParams) => {
return (<React.Fragment>
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>