Merge branch 'feature/2.19.1.2501.01-PC端Token验证' into custom/山林枫同办公系统(0101)
This commit is contained in:
commit
5524a97192
|
|
@ -202,12 +202,21 @@ export const salaryBillSendSum = (params) => {
|
||||||
return postFetch("/api/bs/hrmsalary/salaryBill/send/sum", params);
|
return postFetch("/api/bs/hrmsalary/salaryBill/send/sum", params);
|
||||||
};
|
};
|
||||||
//工资单发放-发送短信验证码
|
//工资单发放-发送短信验证码
|
||||||
export const sendMobileCode = (params) => {
|
export const sendMobileCode = (params, header = {}) => {
|
||||||
return postFetch("/api/bs/hrmsalary/salaryBill/sendMobileCode", params);
|
return postFetch("/api/bs/hrmsalary/salaryBill/sendMobileCode", params, header);
|
||||||
|
};
|
||||||
|
//工资单发放-发送短信验证码
|
||||||
|
export const checkMobileCode = (params, header = {}) => {
|
||||||
|
return postFetch("/api/bs/hrmsalary/salaryBill/checkMobileCode", params, header);
|
||||||
};
|
};
|
||||||
//工资单-验证方式
|
//工资单-验证方式
|
||||||
export const payrollCheckType = params => {
|
export const payrollCheckType = async header => {
|
||||||
return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/payrollCheckType", "GET", params);
|
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 => {
|
export const feedBackSalaryBill = async params => {
|
||||||
|
|
|
||||||
|
|
@ -6,35 +6,36 @@
|
||||||
*/
|
*/
|
||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { WeaDialog, WeaError, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
|
import { WeaDialog, WeaError, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
|
||||||
import { sendMobileCode } from "../../apis/payroll";
|
import { WeaForm, WeaSwitch } from "comsMobx";
|
||||||
import { Button } from "antd";
|
import { checkMobileCode, sendMobileCode } from "../../apis/payroll";
|
||||||
|
import { getQueryString } from "../../util/url";
|
||||||
|
import FormInfo from "../FormInfo";
|
||||||
|
import { captchaCondition } from "../../pages/mobilePayroll/pwdCondtion";
|
||||||
|
import MobileModal from "../../pages/mobilePayroll/mobileModal";
|
||||||
|
import { Button, message } from "antd";
|
||||||
import "./index.less";
|
import "./index.less";
|
||||||
|
|
||||||
|
const form = new WeaForm();
|
||||||
const { getLabel } = WeaLocaleProvider;
|
const { getLabel } = WeaLocaleProvider;
|
||||||
|
|
||||||
class Index extends Component {
|
class Index extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = { captcha: "", time: 60 };
|
||||||
captcha: "",
|
|
||||||
time: 60
|
|
||||||
};
|
|
||||||
this.timeRef = null;
|
this.timeRef = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
form.initFormFields(captchaCondition);
|
||||||
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
clearInterval(this.timeRef);
|
clearInterval(this.timeRef);
|
||||||
}
|
this.setState({ captcha: "", time: 60 });
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps, nextContext) {
|
|
||||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
|
||||||
clearInterval(this.timeRef);
|
|
||||||
this.setState({ captcha: "", time: 60 });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSendCaptcha = () => {
|
handleSendCaptcha = () => {
|
||||||
sendMobileCode({ id: this.props.id }).then(({ status, data }) => {
|
sendMobileCode({ id: this.props.id }, this.props.salaryBillToken).then(({ status }) => {
|
||||||
if (status) {
|
if (status) {
|
||||||
this.timeRef = setInterval(() => {
|
this.timeRef = setInterval(() => {
|
||||||
const { time } = this.state;
|
const { time } = this.state;
|
||||||
|
|
@ -48,44 +49,74 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
handleConfirm = () => {
|
handleConfirm = async () => {
|
||||||
if (!this.state.captcha) {
|
const type = getQueryString("type"), f = await form.validateForm();
|
||||||
|
if (!this.state.captcha && type !== "phone") {
|
||||||
this.refs.weaError.showError();
|
this.refs.weaError.showError();
|
||||||
// return
|
return;
|
||||||
|
} else if (!f.isValid && type === "phone") {
|
||||||
|
f.showErrors();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
this.props.onCancel();
|
checkMobileCode({ id: this.props.id, mobileCode: this.state.captcha }, this.props.salaryBillToken)
|
||||||
this.props.onConfirm();
|
.then(({ status, errormsg }) => {
|
||||||
|
if (status) {
|
||||||
|
this.props.onCancel();
|
||||||
|
this.props.onConfirm();
|
||||||
|
} else {
|
||||||
|
message.error(errormsg);
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { captcha, time } = this.state;
|
const { captcha, time } = this.state, type = getQueryString("type");
|
||||||
return (
|
const itemRender = {
|
||||||
<WeaDialog
|
mobileCode: (field, textAreaProps, form, formParams) => {
|
||||||
initLoadCss {...this.props} style={{ width: 550 }}
|
return (<div className="captchaInputBox">
|
||||||
className="captchaWrapper" title={getLabel(111, "验证码验证")}
|
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}
|
||||||
buttons={[
|
onChange={() => this.setState({ captcha: form.getFormParams().mobileCode })}/>
|
||||||
<Button type="primary" onClick={this.handleConfirm}>{getLabel(826, "确定")}</Button>
|
<Button type="primary" onClick={this.handleSendCaptcha} disabled={time !== 60}>
|
||||||
]}
|
{
|
||||||
>
|
time === 60 ? getLabel(111, "发送验证码") : `${time}S`
|
||||||
<WeaSearchGroup needTigger={false} title="" showGroup>
|
}
|
||||||
<WeaFormItem
|
</Button>
|
||||||
label={getLabel(111, "验证码")}
|
</div>);
|
||||||
labelCol={{ span: 8 }}
|
}
|
||||||
wrapperCol={{ span: 16 }}
|
};
|
||||||
>
|
return (<React.Fragment>
|
||||||
<WeaError tipPosition="bottom" ref="weaError" error={getLabel(826, "验证码未填写")}>
|
{
|
||||||
<div className="captchaInputBox">
|
type === "phone" ? <MobileModal title={getLabel(111, "验证码验证")} onConfirm={this.handleConfirm}>
|
||||||
<WeaInput value={captcha} onChange={captcha => this.setState({ captcha })}/>
|
<FormInfo center={false} itemRender={itemRender} form={form} formFields={captchaCondition}/>
|
||||||
<Button type="primary" onClick={this.handleSendCaptcha} disabled={time !== 60}>
|
</MobileModal> :
|
||||||
{
|
<WeaDialog
|
||||||
time === 60 ? getLabel(111, "发送验证码") : `${time}S`
|
initLoadCss {...this.props} style={{ width: 550 }}
|
||||||
}
|
className="captchaWrapper" title={getLabel(111, "验证码验证")}
|
||||||
</Button>
|
buttons={[
|
||||||
</div>
|
<Button type="primary" onClick={this.handleConfirm}>{getLabel(826, "确定")}</Button>
|
||||||
</WeaError>
|
]}
|
||||||
</WeaFormItem>
|
>
|
||||||
</WeaSearchGroup>
|
<WeaSearchGroup needTigger={false} title="" showGroup>
|
||||||
</WeaDialog>
|
<WeaFormItem
|
||||||
|
label={getLabel(111, "验证码")}
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
wrapperCol={{ span: 16 }}
|
||||||
|
>
|
||||||
|
<WeaError tipPosition="bottom" ref="weaError" error={getLabel(111, "验证码未填写")}>
|
||||||
|
<div className="captchaInputBox">
|
||||||
|
<WeaInput value={captcha} onChange={captcha => this.setState({ captcha })}/>
|
||||||
|
<Button type="primary" onClick={this.handleSendCaptcha} disabled={time !== 60}>
|
||||||
|
{
|
||||||
|
time === 60 ? getLabel(111, "发送验证码") : `${time}S`
|
||||||
|
}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</WeaError>
|
||||||
|
</WeaFormItem>
|
||||||
|
</WeaSearchGroup>
|
||||||
|
</WeaDialog>
|
||||||
|
}
|
||||||
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,25 +5,25 @@
|
||||||
.wea-form-item-wrapper {
|
.wea-form-item-wrapper {
|
||||||
.wea-error {
|
.wea-error {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.captchaInputBox {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.wea-input-normal {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
padding: 8px 10px;
|
|
||||||
border-radius: 0;
|
|
||||||
min-width: 80px;
|
|
||||||
text-align: center;
|
|
||||||
height: 30px;
|
|
||||||
line-height: 15px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.captchaInputBox {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.wea-input-normal {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
padding: 8px 10px;
|
||||||
|
border-radius: 0;
|
||||||
|
min-width: 80px;
|
||||||
|
text-align: center;
|
||||||
|
height: 30px;
|
||||||
|
line-height: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
/*
|
||||||
|
* pc端工资单查看启用二次验证弹框
|
||||||
|
* @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";
|
||||||
|
import LoginVerifyPC from "./loginVerifyPC";
|
||||||
|
import SecondarypwdVerifyPC from "./secondarypwdVerifyPC";
|
||||||
|
|
||||||
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
const form = new WeaForm();
|
||||||
|
|
||||||
|
class CheckSecondaryVerifyDialog extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
loading: false, conditions: [], notSetting: false, loginVerify: false, secondaryVerify: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillReceiveProps(nextProps, nextContext) {
|
||||||
|
if (nextProps.visible !== this.props.visible && nextProps.visible) this.initForm();
|
||||||
|
if (nextProps.visible !== this.props.visible && !nextProps.visible) form.resetForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
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, loginVerify, secondaryVerify
|
||||||
|
} = this.state, { salaryBillToken } = this.props;
|
||||||
|
const itemRender = {
|
||||||
|
authCode: (field, textAreaProps, form, formParams) => {
|
||||||
|
return (<React.Fragment>
|
||||||
|
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
|
||||||
|
{
|
||||||
|
notSetting && <div style={{ clear: "both", paddingTop: 10 }}>
|
||||||
|
{getLabel("111", "您还未设置二次验证密码,点击")}
|
||||||
|
<a href="javascript:void(0);"
|
||||||
|
onClick={() => this.setState({ loginVerify: true })}>{getLabel("30747", "设置")}</a>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</React.Fragment>);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<WeaDialog
|
||||||
|
{...this.props} style={{ width: 550, height: notSetting ? 80 + 26 : 80 }} initLoadCss
|
||||||
|
title={getLabel(111, "身份验证")} buttons={[
|
||||||
|
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(111, "确认")}</Button>
|
||||||
|
]}>
|
||||||
|
<div className="form-dialog-layout">
|
||||||
|
<FormInfo className="form-dialog-layout" center={false} itemRender={itemRender}
|
||||||
|
form={form} formFields={conditions}/>
|
||||||
|
</div>
|
||||||
|
{/*登录密码验证弹框*/}
|
||||||
|
<LoginVerifyPC salaryBillToken={salaryBillToken} visible={loginVerify}
|
||||||
|
onCancel={() => this.setState({ loginVerify: false })}
|
||||||
|
onSetPwdSet={() => this.setState({ secondaryVerify: true })}/>
|
||||||
|
{/*二次密码设置*/}
|
||||||
|
<SecondarypwdVerifyPC salaryBillToken={salaryBillToken} visible={secondaryVerify}
|
||||||
|
onCancel={() => this.setState({ secondaryVerify: false })}
|
||||||
|
onSuccess={this.initForm}/>
|
||||||
|
</WeaDialog>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CheckSecondaryVerifyDialog;
|
||||||
|
|
||||||
|
|
@ -16,18 +16,22 @@ import MobileTemplate from "../../components/mobileTemplate";
|
||||||
import SecondaryVerify from "./secondaryVerify";
|
import SecondaryVerify from "./secondaryVerify";
|
||||||
import LoginVerify from "./loginVerify";
|
import LoginVerify from "./loginVerify";
|
||||||
import SecondarypwdVerify from "./secondarypwdVerify";
|
import SecondarypwdVerify from "./secondarypwdVerify";
|
||||||
|
import CheckSecondaryVerifyDialog from "./checkSecondaryVerifyDialog";
|
||||||
import "../mySalary/index.less";
|
import "../mySalary/index.less";
|
||||||
|
|
||||||
const getLabel = WeaLocaleProvider.getLabel;
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
||||||
@inject("mySalaryStore") @observer
|
@inject("mySalaryStore")
|
||||||
|
@observer
|
||||||
export default class MobilePayroll extends React.Component {
|
export default class MobilePayroll extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
visible: false, captchaVisible: false, loginVisible: false, pwdSetVisible: false,
|
visible: false, captchaVisible: false, loginVisible: false, pwdSetVisible: false,
|
||||||
mySalaryBillData: { employeeInformation: {}, salaryTemplate: [] },
|
mySalaryBillData: { employeeInformation: {}, salaryTemplate: [] },
|
||||||
salaryBillToken: {}
|
salaryBillToken: {},
|
||||||
|
// 统一二次验证
|
||||||
|
checkSecVerify: false
|
||||||
};
|
};
|
||||||
this.id = "";
|
this.id = "";
|
||||||
}
|
}
|
||||||
|
|
@ -37,17 +41,37 @@ export default class MobilePayroll extends React.Component {
|
||||||
this.id = getQueryString("id");
|
this.id = getQueryString("id");
|
||||||
const { mySalaryStore: { init, setMySalaryBill } } = this.props;
|
const { mySalaryStore: { init, setMySalaryBill } } = this.props;
|
||||||
setMySalaryBill({});
|
setMySalaryBill({});
|
||||||
if (type !== "phone") {
|
//统一调用token
|
||||||
const { data, status } = await payrollCheckType();
|
type !== "phone" && await this.initPC();
|
||||||
if (status && data === "PWD") {
|
|
||||||
init(false, () => this.getMySalaryBill(this.id));
|
|
||||||
} else {
|
|
||||||
this.setState({ captchaVisible: true });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
type === "phone" && await this.initMobile();
|
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 () => {
|
initMobile = async () => {
|
||||||
const { mySalaryStore: { setInitEmVerify } } = this.props;
|
const { mySalaryStore: { setInitEmVerify } } = this.props;
|
||||||
if (window.em) {
|
if (window.em) {
|
||||||
|
|
@ -68,15 +92,21 @@ export default class MobilePayroll extends React.Component {
|
||||||
salaryCode: _.pick(params, ["salaryCode"]).salaryCode
|
salaryCode: _.pick(params, ["salaryCode"]).salaryCode
|
||||||
});
|
});
|
||||||
this.setState({ salaryBillToken: data }, () => {
|
this.setState({ salaryBillToken: data }, () => {
|
||||||
API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken)
|
payrollCheckType(this.state.salaryBillToken).then(({ data, status }) => {
|
||||||
.then(({ status, isNeedSecondAuth }) => {
|
if (status && data === "PWD") {
|
||||||
if (status && isNeedSecondAuth) {
|
API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken)
|
||||||
this.setState({ visible: true });
|
.then(({ status, isNeedSecondAuth }) => {
|
||||||
} else {
|
if (status && isNeedSecondAuth) {
|
||||||
this.getMySalaryBill(getQueryString("id"));
|
this.setState({ visible: true });
|
||||||
setInitEmVerify();
|
} else {
|
||||||
}
|
this.getMySalaryBill(getQueryString("id"));
|
||||||
});
|
setInitEmVerify();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.setState({ captchaVisible: true });
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -141,7 +171,7 @@ export default class MobilePayroll extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { mySalaryStore: { setInitEmVerify } } = this.props, {
|
const { mySalaryStore: { setInitEmVerify } } = this.props, {
|
||||||
captchaVisible, visible, loginVisible, pwdSetVisible
|
captchaVisible, visible, loginVisible, pwdSetVisible, checkSecVerify
|
||||||
} = this.state;
|
} = this.state;
|
||||||
const type = getQueryString("type");
|
const type = getQueryString("type");
|
||||||
if (_.isEmpty(toJS(this.props.mySalaryStore.mySalaryBill))) return <React.Fragment>
|
if (_.isEmpty(toJS(this.props.mySalaryStore.mySalaryBill))) return <React.Fragment>
|
||||||
|
|
@ -155,12 +185,24 @@ export default class MobilePayroll extends React.Component {
|
||||||
onSetPwdSet={() => this.setState({ loginVisible: false, pwdSetVisible: true })}/>}
|
onSetPwdSet={() => this.setState({ loginVisible: false, pwdSetVisible: true })}/>}
|
||||||
{pwdSetVisible && <SecondarypwdVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
|
{pwdSetVisible && <SecondarypwdVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
|
||||||
onSuccess={() => this.setState({ pwdSetVisible: false }, () => this.initMobile())}/>}
|
onSuccess={() => this.setState({ pwdSetVisible: false }, () => this.initMobile())}/>}
|
||||||
|
{/*统一外部调用token*/}
|
||||||
|
<CheckSecondaryVerifyDialog visible={checkSecVerify} salaryBillToken={this.state.salaryBillToken}
|
||||||
|
onCancel={(callback) => this.setState({ checkSecVerify: false }, () => callback && callback())}
|
||||||
|
onSuccess={() => {
|
||||||
|
this.getMySalaryBill(getQueryString("id"));
|
||||||
|
setInitEmVerify();
|
||||||
|
}}/>
|
||||||
{/*发送验证码*/}
|
{/*发送验证码*/}
|
||||||
<CaptchaModal
|
{
|
||||||
visible={captchaVisible} id={getQueryString("id")}
|
captchaVisible && <CaptchaModal
|
||||||
onCancel={() => this.setState({ captchaVisible: false })}
|
visible={captchaVisible} id={getQueryString("id")} salaryBillToken={this.state.salaryBillToken}
|
||||||
onConfirm={() => this.props.mySalaryStore.setInitEmVerify()}
|
onCancel={() => this.setState({ captchaVisible: false })}
|
||||||
/>
|
onConfirm={() => {
|
||||||
|
setInitEmVerify();
|
||||||
|
this.getMySalaryBill(getQueryString("id"));
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
</React.Fragment>;
|
</React.Fragment>;
|
||||||
const {
|
const {
|
||||||
salaryTemplate, salaryGroups, employeeInformation, sendTime, confirmStatus, showAck, showFeedback
|
salaryTemplate, salaryGroups, employeeInformation, sendTime, confirmStatus, showAck, showFeedback
|
||||||
|
|
|
||||||
|
|
@ -168,3 +168,13 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
border-left: 1px solid #ddd;
|
border-left: 1px solid #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.secondarypwd-form {
|
||||||
|
.wea-form-cell-wrapper {
|
||||||
|
& > div:last-child {
|
||||||
|
.ant-col-16 {
|
||||||
|
width: 37.5% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 (
|
||||||
|
<WeaDialog
|
||||||
|
{...this.props}
|
||||||
|
style={{ width: 550, height: _.reduce(loginCondition, (pre, cur) => (pre += cur.items.length), 0) * 47 + 33 }}
|
||||||
|
initLoadCss title={getLabel(111, "请先输入登录密码")} buttons={[
|
||||||
|
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(111, "下一步")}</Button>
|
||||||
|
]}>
|
||||||
|
<FormInfo className="form-dialog-layout" center={false} itemRender={{}} form={form}
|
||||||
|
formFields={loginCondition}/>
|
||||||
|
</WeaDialog>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default LoginVerifyPC;
|
||||||
|
|
@ -1,6 +1,25 @@
|
||||||
import { WeaLocaleProvider } from "ecCom";
|
import { WeaLocaleProvider } from "ecCom";
|
||||||
|
|
||||||
const { getLabel } = WeaLocaleProvider;
|
const { getLabel } = WeaLocaleProvider;
|
||||||
|
export const captchaCondition = [
|
||||||
|
{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
colSpan: 1,
|
||||||
|
conditionType: "INPUT",
|
||||||
|
domkey: ["mobileCode"],
|
||||||
|
fieldcol: 18,
|
||||||
|
label: getLabel(111, "验证码"),
|
||||||
|
labelcol: 6,
|
||||||
|
detailtype: 1,
|
||||||
|
rules: "required|string",
|
||||||
|
viewAttr: 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
title: "",
|
||||||
|
defaultshow: true
|
||||||
|
}
|
||||||
|
];
|
||||||
export const loginCondition = [
|
export const loginCondition = [
|
||||||
{
|
{
|
||||||
items: [
|
items: [
|
||||||
|
|
|
||||||
|
|
@ -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 (<React.Fragment>
|
||||||
|
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
|
||||||
|
<img
|
||||||
|
style={{ height: 30, cursor: "pointer", position: "absolute", left: "118%" }}
|
||||||
|
src={this.state.src}
|
||||||
|
onClick={() => {
|
||||||
|
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=""/>
|
||||||
|
</React.Fragment>);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return (<WeaDialog
|
||||||
|
{...this.props} style={{
|
||||||
|
width: 550, height: _.reduce(secondarypwdCondition, (pre, cur) => (pre += cur.items.length), 0) * 47 + 33
|
||||||
|
}} initLoadCss title={getLabel(111, "二次验证密码设置")} buttons={[
|
||||||
|
<Button type="primary" onClick={this.save}>{getLabel(111, "保存")}</Button>
|
||||||
|
]}>
|
||||||
|
<FormInfo className="form-dialog-layout secondarypwd-form" center={false} itemRender={itemRender} form={form}
|
||||||
|
formFields={secondarypwdCondition}/>
|
||||||
|
</WeaDialog>);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SecondarypwdVerifyPC;
|
||||||
|
|
@ -16,12 +16,12 @@ export const formHeaderPost = (url, method, params, header) => {
|
||||||
body: formdata
|
body: formdata
|
||||||
}).then(res => res.json());
|
}).then(res => res.json());
|
||||||
};
|
};
|
||||||
export const postFetch = (url, params) => {
|
export const postFetch = (url, params, header = {}) => {
|
||||||
if (typeof localStorage.access_token === "string" && localStorage.access_token !== "") {
|
if (typeof localStorage.access_token === "string" && localStorage.access_token !== "") {
|
||||||
params.access_token = localStorage.access_token;
|
params.access_token = localStorage.access_token;
|
||||||
}
|
}
|
||||||
url = server + url + "?__random__=" + (new Date()).valueOf();
|
url = server + url + "?__random__=" + (new Date()).valueOf();
|
||||||
return fetch(url, getFetchParams("POST", params)).then(res => res.json());
|
return fetch(url, getFetchParams("POST", params, header)).then(res => res.json());
|
||||||
};
|
};
|
||||||
export const headerRequestFetch = (url, method, params, header) => {
|
export const headerRequestFetch = (url, method, params, header) => {
|
||||||
if (typeof localStorage.access_token === "string" && localStorage.access_token !== "") {
|
if (typeof localStorage.access_token === "string" && localStorage.access_token !== "") {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue