feature/2.19.1.2501.01-移动端查看工资单密码设置
This commit is contained in:
parent
94c9a39f9f
commit
aaf00ace3c
|
|
@ -87,6 +87,7 @@ export default class MobilePayroll extends React.Component {
|
|||
if (status && isNeedSecondAuth) {
|
||||
ReactDom.render(<SecondaryVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
|
||||
onSuccess={() => {
|
||||
setInitEmVerify();
|
||||
removeElementById("am-modal-container");
|
||||
this.getMySalaryBill(getQueryString("id"));
|
||||
}}/>, document.body);
|
||||
|
|
|
|||
|
|
@ -97,6 +97,16 @@
|
|||
.wea-search-group, .wea-content, .wea-form-cell {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.secondarypwd-form {
|
||||
.wea-form-cell-wrapper {
|
||||
& > div:last-child {
|
||||
.ant-col-16 {
|
||||
width: 37.5% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.am-modal-wrap {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import FormInfo from "../../components/FormInfo";
|
|||
import { loginCondition } from "./conditions";
|
||||
import MobileModal from "./mobileModal";
|
||||
import SecondarypwdVerify from "./secondarypwdVerify";
|
||||
import { checkPassword } from "../../apis/mySalaryBenefits";
|
||||
import * as API from "../../apis/mySalaryBenefits";
|
||||
import { RSAEcrypt } from "../../util/RSAUtil";
|
||||
|
||||
const form = new WeaForm();
|
||||
|
|
@ -27,11 +27,15 @@ class LoginVerify extends Component {
|
|||
form.initFormFields(loginCondition);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
form.resetForm();
|
||||
}
|
||||
|
||||
save = async () => {
|
||||
form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
RSAEcrypt("1", { ...form.getFormParams() }).then(RSAParam => {
|
||||
checkPassword({ ...RSAParam }).then(({ result }) => {
|
||||
API.checkPassword({ ...RSAParam }).then(({ result }) => {
|
||||
if (result) {
|
||||
ReactDom.render(<SecondarypwdVerify {...this.props} />, document.body);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,10 @@ class SecondaryVerify extends Component {
|
|||
form.initFormFields(secondaryVerifyConditions);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
form.resetForm();
|
||||
}
|
||||
|
||||
doSecondAuth = () => {
|
||||
form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
|
|
@ -75,7 +79,7 @@ class SecondaryVerify extends Component {
|
|||
}
|
||||
};
|
||||
return (<MobileModal title={getLabel(111, "身份验证")} onConfirm={this.doSecondAuth}>
|
||||
<FormInfo center={false} custLabelCol={10} itemRender={itemRender} form={form}
|
||||
<FormInfo center={false} custLabelCol={9} itemRender={itemRender} form={form}
|
||||
formFields={secondaryVerifyConditions}/>
|
||||
</MobileModal>);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,12 +8,16 @@
|
|||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import ReactDom from "react-dom";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { message } from "antd";
|
||||
import { WeaForm, WeaSwitch } from "comsMobx";
|
||||
import FormInfo from "../../components/FormInfo";
|
||||
import { secondarypwdCondition } from "./conditions";
|
||||
import * as API from "../../apis/mySalaryBenefits";
|
||||
import MobileModal from "./mobileModal";
|
||||
import { RSAEcrypt } from "../../util/RSAUtil";
|
||||
import SecondaryVerify from "./secondaryVerify";
|
||||
|
||||
const form = new WeaForm();
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -31,11 +35,30 @@ class SecondarypwdVerify extends Component {
|
|||
form.initFormFields(secondarypwdCondition);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
form.resetForm();
|
||||
}
|
||||
|
||||
save = async () => {
|
||||
form.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
RSAEcrypt("1", { ...form.getFormParams() }).then(RSAParam => {
|
||||
console.log(form.getFormParams(), this.props);
|
||||
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 }).then(({ sign, message: msg }) => {
|
||||
if (sign === "1") {
|
||||
message.success(msg);
|
||||
ReactDom.render(<SecondaryVerify {...this.props}/>, document.body);
|
||||
} 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();
|
||||
|
|
@ -49,7 +72,7 @@ class SecondarypwdVerify extends Component {
|
|||
return (<React.Fragment>
|
||||
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
|
||||
<img
|
||||
style={{ height: 30, cursor: "pointer", position: "absolute", left: "105%" }}
|
||||
style={{ height: 30, cursor: "pointer", position: "absolute", left: "118%" }}
|
||||
src={this.state.src}
|
||||
onClick={() => {
|
||||
this.setState({ num: this.state.num + 1 }, () => {
|
||||
|
|
@ -60,7 +83,8 @@ class SecondarypwdVerify extends Component {
|
|||
}
|
||||
};
|
||||
return (<MobileModal title={getLabel(111, "二次验证密码设置")} onConfirm={this.save}>
|
||||
<FormInfo center={false} itemRender={itemRender} form={form} formFields={secondarypwdCondition}/>
|
||||
<FormInfo className="secondarypwd-form" center={false} itemRender={itemRender} form={form}
|
||||
formFields={secondarypwdCondition}/>
|
||||
</MobileModal>);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export default class Authority extends React.Component {
|
|||
render() {
|
||||
const { store } = this.props;
|
||||
const { loading, hasRight } = store;
|
||||
|
||||
console.log("store", store);
|
||||
const style = {
|
||||
position: "absolute",
|
||||
top: "50%",
|
||||
|
|
@ -27,6 +27,7 @@ export default class Authority extends React.Component {
|
|||
}
|
||||
|
||||
if (hasRight) {
|
||||
console.log("this.props.children", this.props.children);
|
||||
return this.props.children;
|
||||
} else {
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in New Issue