fix: 修改未登录提示bug

This commit is contained in:
yhui.yang 2017-07-26 17:22:09 +08:00
parent 5268854b30
commit 9b698bc93c
2 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,6 @@ import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types'
import { changeMenuItem } from '../actions/menu'
import { message } from 'antd'
export function requireAuthentication(Component) {
@ -27,7 +26,6 @@ export function requireAuthentication(Component) {
if( !this.props.isAuthenticated ){
this.props.history.push('/');
this.props.changeMenuItem('/');
message.info('请先登录',1);
}
}
render() {

View File

@ -88,6 +88,9 @@ class HeaderCom extends Component {
}
linkTo = (e) =>{
this.props.changeMenuItem(e.key);
if(!this.props.login){
message.info('请先登录',1);
}
}
relieveLink = () => {
this.props.changeMenuItem("");