Compare commits
2 Commits
68663087ee
...
b99b178f61
| Author | SHA1 | Date |
|---|---|---|
|
|
b99b178f61 | |
|
|
90f45a3c7b |
|
|
@ -49,6 +49,10 @@ export const checkPassword = (params, headers) => {
|
||||||
return formHeaderPost("/api/hrm/secondarypwd/checkPassword", "POST", params, headers);
|
return formHeaderPost("/api/hrm/secondarypwd/checkPassword", "POST", params, headers);
|
||||||
// return WeaTools.callApi("/api/hrm/secondarypwd/checkPassword", "POST", params);
|
// 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) => {
|
export const saveSecondaryPwd = (params, headers) => {
|
||||||
return formHeaderPost("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params, headers);
|
return formHeaderPost("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params, headers);
|
||||||
// return WeaTools.callApi("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params);
|
// return WeaTools.callApi("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params);
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ import { ConfirmBtns } from "../mySalary/mySalaryView";
|
||||||
import Content from "../../components/pcTemplate/content";
|
import Content from "../../components/pcTemplate/content";
|
||||||
import MobileTemplate from "../../components/mobileTemplate";
|
import MobileTemplate from "../../components/mobileTemplate";
|
||||||
import SecondaryVerify from "./secondaryVerify";
|
import SecondaryVerify from "./secondaryVerify";
|
||||||
|
import SecondarypwdModify from "./secondarypwdModify";
|
||||||
import LoginVerify from "./loginVerify";
|
import LoginVerify from "./loginVerify";
|
||||||
import SecondarypwdVerify from "./secondarypwdVerify";
|
|
||||||
import "../mySalary/index.less";
|
import "../mySalary/index.less";
|
||||||
|
|
||||||
const getLabel = WeaLocaleProvider.getLabel;
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
@ -25,8 +25,8 @@ export default class MobilePayroll extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
visible: false, captchaVisible: false, loginVisible: false, pwdSetVisible: false,
|
visible: false, captchaVisible: false, loginVisible: false, loginModifyVisible: false, pwdSetVisible: false,
|
||||||
mySalaryBillData: { employeeInformation: {}, salaryTemplate: [] },
|
pwdModifyVisible: false, mySalaryBillData: { employeeInformation: {}, salaryTemplate: [] },
|
||||||
salaryBillToken: {}
|
salaryBillToken: {}
|
||||||
};
|
};
|
||||||
this.id = "";
|
this.id = "";
|
||||||
|
|
@ -141,20 +141,26 @@ export default class MobilePayroll extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { mySalaryStore: { setInitEmVerify } } = this.props, {
|
const { mySalaryStore: { setInitEmVerify } } = this.props, {
|
||||||
captchaVisible, visible, loginVisible, pwdSetVisible
|
captchaVisible, visible, loginVisible, loginModifyVisible, pwdSetVisible, pwdModifyVisible
|
||||||
} = this.state;
|
} = this.state;
|
||||||
const type = getQueryString("type");
|
const type = getQueryString("type");
|
||||||
if (_.isEmpty(toJS(this.props.mySalaryStore.mySalaryBill))) return <React.Fragment>
|
if (_.isEmpty(toJS(this.props.mySalaryStore.mySalaryBill))) return <React.Fragment>
|
||||||
{visible && <SecondaryVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
|
{visible && <SecondaryVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
|
||||||
onSetLogin={() => this.setState({ visible: false, loginVisible: true })}
|
onSetLogin={(key) => this.setState({ visible: false, [key]: true })}
|
||||||
onSuccess={() => {
|
onSuccess={() => {
|
||||||
setInitEmVerify();
|
setInitEmVerify();
|
||||||
this.getMySalaryBill(getQueryString("id"));
|
this.getMySalaryBill(getQueryString("id"));
|
||||||
}}/>}
|
}}/>}
|
||||||
{loginVisible && <LoginVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
|
{loginVisible && <LoginVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
|
||||||
onSetPwdSet={() => this.setState({ loginVisible: false, pwdSetVisible: true })}/>}
|
onSetPwdSet={() => this.setState({
|
||||||
{pwdSetVisible && <SecondarypwdVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
|
loginVisible: false, loginModifyVisible: false, pwdSetVisible: true
|
||||||
onSuccess={() => this.setState({ pwdSetVisible: false }, () => this.initMobile())}/>}
|
})}/>}
|
||||||
|
{loginModifyVisible && <LoginVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
|
||||||
|
onSetPwdSet={() => this.setState({
|
||||||
|
loginVisible: false, loginModifyVisible: false, pwdModifyVisible: true
|
||||||
|
})}/>}
|
||||||
|
{pwdModifyVisible && <SecondarypwdModify {...this.props} salaryBillToken={this.state.salaryBillToken}
|
||||||
|
onSuccess={() => this.setState({ pwdModifyVisible: false }, () => this.initMobile())}/>}
|
||||||
{/*发送验证码*/}
|
{/*发送验证码*/}
|
||||||
<CaptchaModal
|
<CaptchaModal
|
||||||
visible={captchaVisible} id={getQueryString("id")}
|
visible={captchaVisible} id={getQueryString("id")}
|
||||||
|
|
|
||||||
|
|
@ -63,11 +63,17 @@ class SecondaryVerify extends Component {
|
||||||
return (<React.Fragment>
|
return (<React.Fragment>
|
||||||
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
|
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
|
||||||
{
|
{
|
||||||
notSetting &&
|
notSetting ?
|
||||||
<div style={{ clear: "both", paddingTop: 10 }}>
|
<div style={{ clear: "both", paddingTop: 10 }}>
|
||||||
{getLabel(111, "您还未设置二次验证密码,点击")}
|
{getLabel(111, "您还未设置二次验证密码,点击")}
|
||||||
<a href="javascript:void(0);" onClick={this.props.onSetLogin}>{getLabel(111, "设置")}</a>
|
<a href="javascript:void(0);"
|
||||||
</div>
|
onClick={() => this.props.onSetLogin("loginVisible")}>{getLabel(111, "设置")}</a>
|
||||||
|
</div> :
|
||||||
|
<div style={{ clear: "both", paddingTop: 10 }}>
|
||||||
|
{getLabel(111, "二次验证密码已设置,忘记密码点击")}
|
||||||
|
<a href="javascript:void(0);"
|
||||||
|
onClick={() => this.props.onSetLogin("loginModifyVisible")}>{getLabel(111, "修改")}</a>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
</React.Fragment>);
|
</React.Fragment>);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
/*
|
||||||
|
* 联特薪酬工资单查看二开
|
||||||
|
* 二次验证密码修改
|
||||||
|
* @Author: 黎永顺
|
||||||
|
* @Date: 2025/4/28
|
||||||
|
* @Wechat:
|
||||||
|
* @Email: 971387674@qq.com
|
||||||
|
* @description:
|
||||||
|
*/
|
||||||
|
import React, { Component } from "react";
|
||||||
|
import { WeaLocaleProvider } from "ecCom";
|
||||||
|
import { message } from "antd";
|
||||||
|
import { WeaForm, WeaSwitch } from "comsMobx";
|
||||||
|
import FormInfo from "../../components/FormInfo";
|
||||||
|
import { secondarypwdCondition } from "./conditions";
|
||||||
|
import * as API from "../../apis/mySalaryBenefits";
|
||||||
|
import MobileModal from "./mobileModal";
|
||||||
|
import { RSAEcrypt } from "../../util/RSAUtil";
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
form.resetForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
save = async () => {
|
||||||
|
form.validateForm().then(f => {
|
||||||
|
if (f.isValid) {
|
||||||
|
const { secondaryPwd1: newSecondaryPwd1, secondaryPwd2: newSecondaryPwd2, validatecode } = form.getFormParams();
|
||||||
|
if (newSecondaryPwd1 !== newSecondaryPwd1) {
|
||||||
|
form.showError("secondaryPwd2", getLabel(504376, "密码确认不正确!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
RSAEcrypt("1", { newSecondaryPwd1, newSecondaryPwd2 }).then(RSAParam => {
|
||||||
|
API.saveSecondaryPwd({ ...RSAParam, validatecode }, 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}` });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
f.showErrors();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
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}/>
|
||||||
|
<img
|
||||||
|
style={{ height: 30, cursor: "pointer", position: "absolute", left: "118%" }}
|
||||||
|
src={this.state.src}
|
||||||
|
onClick={() => {
|
||||||
|
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=""/>
|
||||||
|
</React.Fragment>);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return (<MobileModal title={getLabel(111, "二次验证密码设置")} onConfirm={this.save}>
|
||||||
|
<FormInfo className="secondarypwd-form" center={false} itemRender={itemRender} form={form}
|
||||||
|
formFields={secondarypwdCondition}/>
|
||||||
|
</MobileModal>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SecondarypwdModify;
|
||||||
Loading…
Reference in New Issue