fix: 加上未登录提示

This commit is contained in:
yhui.yang 2017-07-26 16:45:21 +08:00
parent cfaca47d82
commit 6fc86e8078
2 changed files with 16 additions and 5 deletions

View File

@ -2,6 +2,7 @@ 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) {
@ -26,6 +27,7 @@ export function requireAuthentication(Component) {
if( !this.props.isAuthenticated ){
this.props.history.push('/');
this.props.changeMenuItem('/');
message.info('请先登录',1);
}
}
render() {

View File

@ -13,6 +13,7 @@ import QueueAnim from 'rc-queue-anim';
const oneAnim = { y: '+=30', opacity: 0, type: 'from', ease: 'easeOutQuad' };
const imgAnim = { y: '+=50', opacity: 0, type: 'from', ease: 'easeOutQuad', duration: '1500'};
const style = {
'height':'100%',
'width':'100%',
@ -36,11 +37,19 @@ const HomeGuest = (props) => (
<Col span={8} className="main-one-left">
<Login/>
</Col>
<Col span={16} className="main-one-right">
<div className="img-container">
<img src="./image/demo-img.png"/>
</div>
</Col>
<OverPack>
<TweenOne
key="feat-motion-one"
animation={imgAnim}
>
<Col span={16} className="main-one-right">
<div className="img-container">
<img src="./image/demo-img.png"/>
</div>
</Col>
</TweenOne>
</OverPack>
</Row>
</div>
</div>