From 40c7a4f7a04d59ec97cc7e15d07249f6b09be8f1 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 25 Apr 2025 13:55:23 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.19.1.2501.01-PC=E7=AB=AFToken?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/captchaModal/index.js | 27 +++++------- .../hrmSalary/pages/mobilePayroll/index.js | 42 +++++++++++-------- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/pc4mobx/hrmSalary/components/captchaModal/index.js b/pc4mobx/hrmSalary/components/captchaModal/index.js index 1ae52279..efe657ba 100644 --- a/pc4mobx/hrmSalary/components/captchaModal/index.js +++ b/pc4mobx/hrmSalary/components/captchaModal/index.js @@ -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 }); - } + 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,14 +58,15 @@ class Index extends Component { f.showErrors(); return; } - checkMobileCode({ id: this.props.id, mobileCode: this.state.captcha }).then(({ status, errormsg }) => { - if (status) { - this.props.onCancel(); - this.props.onConfirm(); - } else { - message.error(errormsg); - } - }); + checkMobileCode({ id: this.props.id, mobileCode: this.state.captcha }, this.props.salaryBillToken) + .then(({ status, errormsg }) => { + if (status) { + this.props.onCancel(); + this.props.onConfirm(); + } else { + message.error(errormsg); + } + }); }; render() { diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index e6c1df11..35544ea5 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -92,15 +92,21 @@ export default class MobilePayroll extends React.Component { salaryCode: _.pick(params, ["salaryCode"]).salaryCode }); this.setState({ salaryBillToken: data }, () => { - API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) - .then(({ status, isNeedSecondAuth }) => { - if (status && isNeedSecondAuth) { - this.setState({ visible: true }); - } else { - this.getMySalaryBill(getQueryString("id")); - setInitEmVerify(); - } - }); + 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) { + this.setState({ visible: true }); + } else { + this.getMySalaryBill(getQueryString("id")); + setInitEmVerify(); + } + }); + } else { + this.setState({ captchaVisible: true }); + } + }); }); } }; @@ -187,14 +193,16 @@ export default class MobilePayroll extends React.Component { setInitEmVerify(); }}/> {/*发送验证码*/} - this.setState({ captchaVisible: false })} - onConfirm={() => { - setInitEmVerify(); - this.getMySalaryBill(getQueryString("id")); - }} - /> + { + captchaVisible && this.setState({ captchaVisible: false })} + onConfirm={() => { + setInitEmVerify(); + this.getMySalaryBill(getQueryString("id")); + }} + /> + } ; const { salaryTemplate, salaryGroups, employeeInformation, sendTime, confirmStatus, showAck, showFeedback