diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index eaa34aff..882b0f9b 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -87,6 +87,7 @@ export default class MobilePayroll extends React.Component { if (status && isNeedSecondAuth) { ReactDom.render( { + setInitEmVerify(); removeElementById("am-modal-container"); this.getMySalaryBill(getQueryString("id")); }}/>, document.body); diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.less b/pc4mobx/hrmSalary/pages/mobilePayroll/index.less index 8d600fc5..9fd7d4d6 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.less +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.less @@ -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 { diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js index 1be34d7a..ad862dcf 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js @@ -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(, document.body); } else { diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js index 1660dfee..c80215a4 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js @@ -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 ( - ); } diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js index fece44bd..5a5d58cd 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js @@ -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(, 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 ( { this.setState({ num: this.state.num + 1 }, () => { @@ -60,7 +83,8 @@ class SecondarypwdVerify extends Component { } }; return ( - + ); } } diff --git a/pc4mobx/hrmSalary/pages/mySalary/authority.js b/pc4mobx/hrmSalary/pages/mySalary/authority.js index 00a74712..ef7261be 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/authority.js +++ b/pc4mobx/hrmSalary/pages/mySalary/authority.js @@ -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 (