| | |
| | | initMenuPermission, |
| | | logout |
| | | } from '@/store/action' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncComponent from '@/utils/asyncSpinComponent' |
| | | import Api from '@/api' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import options from '@/store/options.js' |
| | |
| | | visible: false, // 修改密码模态框 |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | confirmLoading: false, |
| | | userName: sessionStorage.getItem('User_Name'), |
| | | userName: '', |
| | | fullName: '', |
| | | logourl: window.GLOB.mainlogo, |
| | | appVersion: window.GLOB.appVersion, |
| | | loginVisible: false, |
| | |
| | | } |
| | | |
| | | resetPwdSubmit = () => { |
| | | if (!this.formRef) return |
| | | |
| | | this.formRef.handleConfirm().then(res => { |
| | | this.setState({ |
| | | confirmLoading: true |
| | |
| | | } |
| | | |
| | | loginSubmit = () => { |
| | | if (!this.loginRef) return |
| | | |
| | | this.setState({ |
| | | loginLoading: true |
| | | }) |
| | | |
| | | this.loginRef.handleConfirm().then(param => { |
| | | Api.getusermsg(param.username, param.password, true).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loginLoading: false |
| | | }) |
| | | |
| | | if (res.modifydate) { |
| | | let s = (new Date().getTime() - new Date(res.modifydate).getTime()) / (1000 * 24 * 60 * 60) |
| | | if (!isNaN(s) && s > 90) { |
| | | Modal.warning({ |
| | | width: 520, |
| | | title: <span>系统检测到您的账户存在风险,请及时到<a target="_blank" rel="noopener noreferrer" href="https://cloud.mk9h.cn/admin/index.html">云中心</a>修改密码!</span>, |
| | | okText: '知道了' |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | sessionStorage.setItem('CloudUserID', res.UserID) |
| | | sessionStorage.setItem('CloudLoginUID', res.LoginUID) |
| | | sessionStorage.setItem('CloudUserName', res.UserName) |
| | |
| | | UNSAFE_componentWillMount () { |
| | | // 组件加载时,获取菜单数据 |
| | | this.getRolesMenu() |
| | | |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | |
| | | if (fullName.toLowerCase() === userName.toLowerCase()) { |
| | | userName = '' |
| | | } |
| | | |
| | | this.setState({fullName, userName}) |
| | | } |
| | | |
| | | componentDidMount () { |
| | |
| | | let url = `${ssodomain}/doc/index.html#?appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}` |
| | | window.open(url) |
| | | } else if (options.sysType === 'SSO' || options.sysType === 'cloud') { |
| | | window.open(`${window.location.href.replace(/\/index.html(.*)|\/#(.*)/ig, '')}/doc/index.html#?appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}`) |
| | | window.open(`${window.location.href.replace(/\/admin(.*)|\/index.html(.*)|\/#(.*)/ig, '')}/doc/index.html#?appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}`) |
| | | } |
| | | } |
| | | |
| | |
| | | <div> |
| | | <img src={this.state.avatar || avatar} alt=""/> |
| | | <span> |
| | | <span className="username">{this.state.userName}</span> <DownOutlined /> |
| | | <span className="username"><span>{this.state.fullName}</span>{this.state.userName ? <span>{this.state.userName}</span> : null}</span> <DownOutlined /> |
| | | </span> |
| | | </div> |
| | | </Dropdown> |