import React from 'react' import { inject, observer, } from 'mobx-react'; import { Spin, Button, } from 'antd' import { WeaLocaleProvider } from 'ecCom'; import MainDialog from './MainDialog'; import {addContentPath} from '../../util/index.js' const getLabel = WeaLocaleProvider.getLabel; @inject('hrmSecondaryVerify') @observer export default class SecondaryVerify extends React.Component { constructor(props) { super(props); } componentDidMount() { const { hrmSecondaryVerify } = this.props, { isSettedSecondaryPwd } = hrmSecondaryVerify; isSettedSecondaryPwd(); } componentWillUnmount() { this.props.hrmSecondaryVerify.resetSecondaryVerify() } getDescription = (isSetted) => { let ele; if (!isSetted) { const desc = [getLabel('504320', "什么是二次验证密码?"), `${getLabel('506871', "用于身份确认的二次验证密码")},${getLabel('504322', "为保安全性,请设置为和登录密码不同的密码。")}`]; ele = desc.map((item, index) => { return
{`${index==0 ? '•' : ''} ${item}`}
}); } else { const status = ({getLabel('504323',"二次验证密码状态")} : {getLabel('504324',"已设置")}
); const desc = [getLabel('504325', "二次验证密码可以自行停用吗?"), getLabel('504326', "不可以,只能由管理员操作。"), getLabel('504327', "二次验证密码忘记了怎么办?"), getLabel('504328', "请联系系统管理员解决。")]; ele = desc.map((item, index) => { return{`${[0,2].includes(index) ? '•' : ''} ${item}`}
}); ele.unshift(status); } return ele; } getButton = (isSetted) => { const { hrmSecondaryVerify } = this.props, { setSecondaryVerify, modifySecondaryPass, } = hrmSecondaryVerify; let btn; if (!isSetted) { btn = } else { btn = } return btn; } getPaddingLeft = () => { const w = window.innerWidth || document.body.clientWidth; let pl; if (w > 1366) { pl = '28%'; } else { pl = '23%'; } return pl; } render() { const { hrmSecondaryVerify } = this.props, { secondaryVerify } = hrmSecondaryVerify, { isSetted, loading, } = secondaryVerify; if (loading) { return (