From ce26eadb135b8a63f79edc4fcf962f0eee36a6f1 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 4 Mar 2025 17:04:16 +0800 Subject: [PATCH] =?UTF-8?q?custom/=E9=A2=86=E6=82=A6=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/payroll.js | 8 +++-- .../hrmSalary/pages/mobilePayroll/index.js | 36 +++++++++---------- 2 files changed, 23 insertions(+), 21 deletions(-) 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 () => {