diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index bd152a29..69329ae3 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -54,9 +54,7 @@ export default class MobilePayroll extends React.Component { initMobile = async () => { const { mySalaryStore: { setInitEmVerify } } = this.props; - const params = this.getUrlkey(); - const { data } = await salaryBillGetToken({ uid: _.pick(params, ["recipient"]).recipient }); - this.setState({ salaryBillToken: data }, () => { + if (window.em) { API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) .then(({ status, isNeedSecondAuth }) => { if (status && isNeedSecondAuth) { @@ -71,7 +69,26 @@ export default class MobilePayroll extends React.Component { setInitEmVerify(); } }); - }); + } else { + const params = this.getUrlkey(); + const { data } = await salaryBillGetToken({ uid: _.pick(params, ["recipient"]).recipient }); + this.setState({ salaryBillToken: data }, () => { + API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) + .then(({ status, isNeedSecondAuth }) => { + if (status && isNeedSecondAuth) { + this.setState({ visible: true }, () => { + API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) + .then(({ status, notSetting }) => { + this.setState({ notSetting }); + }); + }); + } else { + this.getMySalaryBill(getQueryString("id")); + setInitEmVerify(); + } + }); + }); + } }; doSecondAuth = () => { const { salaryBillToken } = this.state; @@ -143,7 +160,7 @@ export default class MobilePayroll extends React.Component { const { salaryTemplate } = mySalaryBillData; const { feedbackUrl } = salaryTemplate; this.getMySalaryBill(getQueryString("id")); - window.location.href=`${window.ecologyContentPath || ""}${feedbackUrl}` + window.location.href = `${window.ecologyContentPath || ""}${feedbackUrl}`; // window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`); } else { message.error(errorMsg); @@ -174,7 +191,8 @@ export default class MobilePayroll extends React.Component { ]} > - this.setState({ authCode })}/> + this.setState({ authCode })}/> { notSetting &&