diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index 48fcecb2..cdf02662 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -206,8 +206,12 @@ export const sendMobileCode = (params) => { return postFetch("/api/bs/hrmsalary/salaryBill/sendMobileCode", params); }; //工资单-验证方式 -export const payrollCheckType = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/payrollCheckType", "GET", params); +export const payrollCheckType = header => { + return fetch(`/api/bs/hrmsalary/salaryBill/payrollCheckType`, { + method: "GET", + mode: "cors", + headers: { "Content-Type": "application/json", ...header } + }).then(res => res.json()); }; //工资单-反馈验证 export const feedBackSalaryBill = params => { diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index 0f072dca..0ff55c6e 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -46,16 +46,7 @@ export default class MobilePayroll extends React.Component { this.id = getQueryString("id"); const { mySalaryStore: { init, setMySalaryBill } } = this.props; setMySalaryBill({}); - if (type !== "phone") { - const { data, status } = await payrollCheckType(); - if (status && data === "PWD") { - // init(false, () => this.getMySalaryBill(this.id)); - //领悦二开 - await this.initLY(); - } else { - this.setState({ captchaVisible: true }); - } - } + type !== "phone" && await this.initLY(); type === "phone" && await this.initMobile(); } @@ -68,15 +59,22 @@ 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({ LYCheckSecVerify: true }); - } else { - this.getMySalaryBill(getQueryString("id")); - setInitEmVerify(); - } - }); + //领悦二开 + payrollCheckType().then(({ data, status }) => { + if (status && data === "PWD") { + API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) + .then(({ status, isNeedSecondAuth }) => { + if (status && isNeedSecondAuth) { + this.setState({ LYCheckSecVerify: true }); + } else { + this.getMySalaryBill(getQueryString("id")); + setInitEmVerify(); + } + }); + } else { + this.setState({ captchaVisible: true }); + } + }); }); }; initMobile = async () => {