feature/2.19.1.2501.01-PC端Token验证
This commit is contained in:
parent
fad6c3a2b1
commit
40c7a4f7a0
|
|
@ -31,17 +31,11 @@ class Index extends Component {
|
|||
|
||||
componentWillUnmount() {
|
||||
clearInterval(this.timeRef);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
clearInterval(this.timeRef);
|
||||
this.setState({ captcha: "", time: 60 });
|
||||
}
|
||||
}
|
||||
|
||||
handleSendCaptcha = () => {
|
||||
sendMobileCode({ id: this.props.id }).then(({ status, data }) => {
|
||||
sendMobileCode({ id: this.props.id }, this.props.salaryBillToken).then(({ status }) => {
|
||||
if (status) {
|
||||
this.timeRef = setInterval(() => {
|
||||
const { time } = this.state;
|
||||
|
|
@ -64,7 +58,8 @@ class Index extends Component {
|
|||
f.showErrors();
|
||||
return;
|
||||
}
|
||||
checkMobileCode({ id: this.props.id, mobileCode: this.state.captcha }).then(({ status, errormsg }) => {
|
||||
checkMobileCode({ id: this.props.id, mobileCode: this.state.captcha }, this.props.salaryBillToken)
|
||||
.then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
this.props.onCancel();
|
||||
this.props.onConfirm();
|
||||
|
|
|
|||
|
|
@ -92,6 +92,8 @@ export default class MobilePayroll extends React.Component {
|
|||
salaryCode: _.pick(params, ["salaryCode"]).salaryCode
|
||||
});
|
||||
this.setState({ salaryBillToken: data }, () => {
|
||||
payrollCheckType(this.state.salaryBillToken).then(({ data, status }) => {
|
||||
if (status && data === "PWD") {
|
||||
API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken)
|
||||
.then(({ status, isNeedSecondAuth }) => {
|
||||
if (status && isNeedSecondAuth) {
|
||||
|
|
@ -101,6 +103,10 @@ export default class MobilePayroll extends React.Component {
|
|||
setInitEmVerify();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setState({ captchaVisible: true });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -187,14 +193,16 @@ export default class MobilePayroll extends React.Component {
|
|||
setInitEmVerify();
|
||||
}}/>
|
||||
{/*发送验证码*/}
|
||||
<CaptchaModal
|
||||
visible={captchaVisible} id={getQueryString("id")}
|
||||
{
|
||||
captchaVisible && <CaptchaModal
|
||||
visible={captchaVisible} id={getQueryString("id")} salaryBillToken={this.state.salaryBillToken}
|
||||
onCancel={() => this.setState({ captchaVisible: false })}
|
||||
onConfirm={() => {
|
||||
setInitEmVerify();
|
||||
this.getMySalaryBill(getQueryString("id"));
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</React.Fragment>;
|
||||
const {
|
||||
salaryTemplate, salaryGroups, employeeInformation, sendTime, confirmStatus, showAck, showFeedback
|
||||
|
|
|
|||
Loading…
Reference in New Issue