From 83607e1c0d0018cf88bf3afb3dc3434b06f026dc Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 15 Apr 2025 16:54:11 +0800 Subject: [PATCH 1/5] =?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 --- pc4mobx/hrmSalary/apis/payroll.js | 9 +- .../checkSecondaryVerifyDialog.js | 93 +++++++++++++++++++ .../hrmSalary/pages/mobilePayroll/index.js | 63 +++++++++---- 3 files changed, 147 insertions(+), 18 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index c322c94f..01932e6a 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -206,8 +206,13 @@ 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 = async header => { + const res = await fetch(`/api/bs/hrmsalary/salaryBill/payrollCheckType`, { + method: "GET", + mode: "cors", + headers: { "Content-Type": "application/json", ...header } + }); + return await res.json(); }; //工资单-反馈验证 export const feedBackSalaryBill = async params => { diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js b/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js new file mode 100644 index 00000000..b7a492b5 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js @@ -0,0 +1,93 @@ +/* + * 工资单查看启用二次验证弹框 + * @Author: 黎永顺 + * @Date: 2025/4/15 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { WeaForm, WeaSwitch } from "comsMobx"; +import { Button, message } from "antd"; +import * as API from "../../apis/mySalaryBenefits"; +import FormInfo from "../../components/FormInfo"; + +const getLabel = WeaLocaleProvider.getLabel; +const form = new WeaForm(); + +class CheckSecondaryVerifyDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, conditions: [], notSetting: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.initForm(); + if (nextProps.visible !== this.props.visible && !nextProps.visible) form.initSecVerifyform(); + } + + initForm = () => { + const { salaryBillToken } = this.props; + API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }, salaryBillToken) + .then(({ conditions, notSetting }) => { + this.setState({ conditions: [{ title: "", items: conditions }], notSetting }, () => { + form.initFormFields(this.state.conditions); + }); + }); + }; + save = () => { + const { salaryBillToken } = this.props; + form.validateForm().then(f => { + if (f.isValid) { + const payload = { ...form.getFormParams() }; + API.doSecondAuth({ ...payload, mouldCode: "HRM", itemCode: "SALARY" }, salaryBillToken) + .then(({ status, checkStatus, checkMsg }) => { + if (status && checkStatus === "1") { + message.success(checkMsg); + this.props.onCancel(this.props.onSuccess); + } else { + message.error(checkMsg); + } + }); + } else { + f.showErrors(); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { conditions, loading, notSetting } = this.state; + const itemRender = { + authCode: (field, textAreaProps, form, formParams) => { + return ( + + { + notSetting &&
+ {getLabel("111", "您还未设置二次验证密码,请先在系统中设置验证密码")} + {/* this.setState({ pwdSetVisible: true })}>{getLabel("30747", "设置")}*/} +
+ } +
); + } + }; + return ( + {getLabel(111, "确认")} + ]}> +
+ +
+
+ ); + } +} + +export default CheckSecondaryVerifyDialog; + diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index 69d84928..927ae3ee 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -14,6 +14,7 @@ import PassSetDialog from "./passSetDialog"; import { ConfirmBtns } from "../mySalary/mySalaryView"; import Content from "../../components/pcTemplate/content"; import MobileTemplate from "../../components/mobileTemplate"; +import CheckSecondaryVerifyDialog from "./checkSecondaryVerifyDialog"; import "../mySalary/index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -33,7 +34,9 @@ export default class MobilePayroll extends React.Component { employeeInformation: {}, salaryTemplate: [] }, - salaryBillToken: {} + salaryBillToken: {}, + // 统一二次验证 + checkSecVerify: false }; this.id = ""; } @@ -43,17 +46,37 @@ 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)); - } else { - this.setState({ captchaVisible: true }); - } - } + //统一调用token + type !== "phone" && await this.initPC(); type === "phone" && await this.initMobile(); } + initPC = async () => { + const { mySalaryStore: { setInitEmVerify } } = this.props; + const params = this.getUrlkey(); + const { data } = await salaryBillGetToken({ + id: _.pick(params, ["id"]).id, + recipient: _.pick(params, ["recipient"]).recipient, + 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) { + this.setState({ checkSecVerify: true }); + } else { + this.getMySalaryBill(getQueryString("id")); + setInitEmVerify(); + } + }); + } else { + this.setState({ captchaVisible: true }); + } + }); + }); + }; initMobile = async () => { const { mySalaryStore: { setInitEmVerify } } = this.props; if (window.em) { @@ -179,8 +202,8 @@ export default class MobilePayroll extends React.Component { }; render() { - const { mySalaryStore: { clearLoading, pwdForm } } = this.props; - const { mySalaryBillData, visible, captchaVisible, notSetting, pwdSetVisible } = this.state; + const { mySalaryStore: { clearLoading, pwdForm, setInitEmVerify } } = this.props; + const { salaryBillToken, visible, captchaVisible, notSetting, pwdSetVisible, checkSecVerify } = this.state; const type = getQueryString("type"); if (_.isEmpty(toJS(this.props.mySalaryStore.mySalaryBill))) return
this.setState({ pwdSetVisible: false })}/> + {/*统一外部调用token*/} + this.setState({ checkSecVerify: false }, () => callback && callback())} + onSuccess={() => { + this.getMySalaryBill(getQueryString("id")); + setInitEmVerify(); + }}/> + {/*发送验证码*/} + this.setState({ captchaVisible: false })} + onConfirm={() => this.props.mySalaryStore.setInitEmVerify()} + />
; const { salaryTemplate, salaryGroups, employeeInformation, @@ -243,11 +279,6 @@ export default class MobilePayroll extends React.Component { } - this.setState({ captchaVisible: false })} - onConfirm={() => this.props.mySalaryStore.setInitEmVerify()} - /> ); } From babbf88c1509da214b83dc3b91310bef6e36a579 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 15 Apr 2025 17:18:13 +0800 Subject: [PATCH 2/5] =?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 --- .../hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js b/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js index b7a492b5..30e7b54b 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js @@ -26,7 +26,7 @@ class CheckSecondaryVerifyDialog extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) this.initForm(); - if (nextProps.visible !== this.props.visible && !nextProps.visible) form.initSecVerifyform(); + if (nextProps.visible !== this.props.visible && !nextProps.visible) form.resetForm(); } initForm = () => { From ae7785ff6e77850146a636510c866ffceb8b1d7e Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 18 Apr 2025 11:39:11 +0800 Subject: [PATCH 3/5] =?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 --- .../hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js | 2 +- pc4mobx/hrmSalary/pages/mobilePayroll/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js b/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js index 30e7b54b..97d46aac 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js @@ -1,5 +1,5 @@ /* - * 工资单查看启用二次验证弹框 + * pc端工资单查看启用二次验证弹框 * @Author: 黎永顺 * @Date: 2025/4/15 * @Wechat: diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index ba6502f8..9e9da440 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -180,7 +180,7 @@ export default class MobilePayroll extends React.Component { {pwdSetVisible && this.setState({ pwdSetVisible: false }, () => this.initMobile())}/>} {/*统一外部调用token*/} - this.setState({ checkSecVerify: false }, () => callback && callback())} onSuccess={() => { this.getMySalaryBill(getQueryString("id")); From 0b081877f4abf72cb3404b58e235c66288ff7f6d Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Wed, 23 Apr 2025 13:30:27 +0800 Subject: [PATCH 4/5] =?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 --- .../checkSecondaryVerifyDialog.js | 22 ++++- .../hrmSalary/pages/mobilePayroll/index.less | 10 ++ .../pages/mobilePayroll/loginVerifyPC.js | 72 ++++++++++++++ .../mobilePayroll/secondarypwdVerifyPC.js | 96 +++++++++++++++++++ 4 files changed, 195 insertions(+), 5 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/mobilePayroll/loginVerifyPC.js create mode 100644 pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerifyPC.js diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js b/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js index 97d46aac..980fb316 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js @@ -12,6 +12,8 @@ import { WeaForm, WeaSwitch } from "comsMobx"; import { Button, message } from "antd"; import * as API from "../../apis/mySalaryBenefits"; import FormInfo from "../../components/FormInfo"; +import LoginVerifyPC from "./loginVerifyPC"; +import SecondarypwdVerifyPC from "./secondarypwdVerifyPC"; const getLabel = WeaLocaleProvider.getLabel; const form = new WeaForm(); @@ -20,7 +22,7 @@ class CheckSecondaryVerifyDialog extends Component { constructor(props) { super(props); this.state = { - loading: false, conditions: [], notSetting: false + loading: false, conditions: [], notSetting: false, loginVerify: false, secondaryVerify: false }; } @@ -59,16 +61,18 @@ class CheckSecondaryVerifyDialog extends Component { }; render() { - const { conditions, loading, notSetting } = this.state; + const { + conditions, loading, notSetting, loginVerify, secondaryVerify + } = this.state, { salaryBillToken } = this.props; const itemRender = { authCode: (field, textAreaProps, form, formParams) => { return ( { notSetting &&
- {getLabel("111", "您还未设置二次验证密码,请先在系统中设置验证密码")} - {/* this.setState({ pwdSetVisible: true })}>{getLabel("30747", "设置")}*/} + {getLabel("111", "您还未设置二次验证密码,点击")} + this.setState({ loginVerify: true })}>{getLabel("30747", "设置")}
}
); @@ -84,6 +88,14 @@ class CheckSecondaryVerifyDialog extends Component { + {/*登录密码验证弹框*/} + this.setState({ loginVerify: false })} + onSetPwdSet={() => this.setState({ secondaryVerify: true })}/> + {/*二次密码设置*/} + this.setState({ secondaryVerify: false })} + onSuccess={this.initForm}/> ); } diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.less b/pc4mobx/hrmSalary/pages/mobilePayroll/index.less index 9fd7d4d6..6e78c87e 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.less +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.less @@ -168,3 +168,13 @@ position: relative; border-left: 1px solid #ddd; } + +.secondarypwd-form { + .wea-form-cell-wrapper { + & > div:last-child { + .ant-col-16 { + width: 37.5% !important; + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerifyPC.js b/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerifyPC.js new file mode 100644 index 00000000..b9d0db85 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerifyPC.js @@ -0,0 +1,72 @@ +/* + * 二次验证 + * 登录密码验证 + * @Author: 黎永顺 + * @Date: 2025/4/23 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { WeaForm } from "comsMobx"; +import { Button } from "antd"; +import FormInfo from "../../components/FormInfo"; +import { loginCondition } from "./pwdCondtion"; +import { RSAEcrypt } from "../../util/RSAUtil"; +import * as API from "../../apis/mySalaryBenefits"; + +const form = new WeaForm(); +const getLabel = WeaLocaleProvider.getLabel; + +class LoginVerifyPC extends Component { + constructor(props) { + super(props); + this.state = { loading: false }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + form.initFormFields(loginCondition); + } else { + form.resetForm(); + } + } + + save = async () => { + form.validateForm().then(f => { + if (f.isValid) { + RSAEcrypt("1", { ...form.getFormParams() }, this.props.salaryBillToken) + .then(RSAParam => { + API.checkPassword({ ...RSAParam }).then(({ result }) => { + if (result) { + this.props.onCancel(); + this.props.onSetPwdSet(); + } else { + form.showError("password", getLabel(504343, "登录密码错误")); + } + }); + }); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { loading } = this.state; + return ( + (pre += cur.items.length), 0) * 47 + 33 }} + initLoadCss title={getLabel(111, "请先输入登录密码")} buttons={[ + + ]}> + + + ); + } +} + +export default LoginVerifyPC; diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerifyPC.js b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerifyPC.js new file mode 100644 index 00000000..fd139ae7 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerifyPC.js @@ -0,0 +1,96 @@ +/* + * 二次验证密码设置 + * + * @Author: 黎永顺 + * @Date: 2025/4/17 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button, message } from "antd"; +import { WeaForm, WeaSwitch } from "comsMobx"; +import FormInfo from "../../components/FormInfo"; +import { secondarypwdCondition } from "./conditions"; +import * as API from "../../apis/mySalaryBenefits"; +import { RSAEcrypt } from "../../util/RSAUtil"; + +const form = new WeaForm(); +const getLabel = WeaLocaleProvider.getLabel; + +class SecondarypwdVerifyPC extends Component { + constructor(props) { + super(props); + this.state = { + src: (window.ecologyContentPath || "") + "/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4", + num: 0 + }; + } + + componentDidMount() { + form.initFormFields(secondarypwdCondition); + } + + componentWillUnmount() { + form.resetForm(); + } + + save = async () => { + form.validateForm().then(f => { + if (f.isValid) { + const { secondaryPwd1, secondaryPwd2, validatecode } = form.getFormParams(); + if (secondaryPwd1 !== secondaryPwd2) { + form.showError("secondaryPwd2", getLabel(504376, "密码确认不正确!")); + return; + } + RSAEcrypt("1", { secondaryPwd1, secondaryPwd2 }).then(RSAParam => { + API.saveSecondaryPwd({ ...RSAParam, validatecode }, this.props.salaryBillToken) + .then(({ sign, message: msg }) => { + if (sign === "1") { + message.success(msg); + this.props.onCancel(); + this.props.onSuccess(); + } else { + form.showError("validatecode", msg); + this.setState({ num: this.state.num + 1 }, () => { + this.setState({ src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}` }); + }); + } + }); + }); + } else { + f.showErrors(); + } + }); + }; + + render() { + const itemRender = { + validatecode: (field, textAreaProps, form, formParams) => { + return ( + + { + this.setState({ num: this.state.num + 1 }, () => { + this.setState({ src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}` }); + }); + }} alt=""/> + ); + } + }; + return ( (pre += cur.items.length), 0) * 47 + 33 + }} initLoadCss title={getLabel(111, "二次验证密码设置")} buttons={[ + + ]}> + + ); + } +} + +export default SecondarypwdVerifyPC; 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 5/5] =?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