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

View File

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