fix: qsso error bug

This commit is contained in:
suxiaoxin 2017-08-25 19:17:57 +08:00
parent 7653d07704
commit 72fc6e6d7c

View File

@ -42,7 +42,7 @@ const HomeGuest = () => (
</Col> </Col>
<Col lg={15} xs={0} className="col-img"> <Col lg={15} xs={0} className="col-img">
<div className="img-container"> <div className="img-container">
<img className="img" src={getImgPath('./image/demo-img', 'jpg')}/> <img className="img" src={getImgPath('/image/demo-img', 'jpg')} />
</div> </div>
</Col> </Col>
</Row> </Row>
@ -172,8 +172,15 @@ class Home extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
} }
componentWillMount() {
if (this.props.login) {
this.props.history.push('/group/261')
}
}
componentDidMount() { componentDidMount() {
if(window.QSSO) window.QSSO.attach('qsso-login','/api/user/login_by_token') if (window.QSSO && document.getElementById('qsso-login')) window.QSSO.attach('qsso-login', '/api/user/login_by_token')
} }
static propTypes = { static propTypes = {
introList: PropTypes.array, introList: PropTypes.array,
@ -185,10 +192,9 @@ class Home extends Component {
this.props.changeMenuItem('/group'); this.props.changeMenuItem('/group');
} }
render() { render() {
const { login } = this.props;
return ( return (
<div className="home-main"> <div className="home-main">
{login? this.props.history.push('/group') : <HomeGuest introList={this.props.introList}/>} <HomeGuest introList={this.props.introList} />
<div className="row-tip"> <div className="row-tip">
<div className="container"> <div className="container">
<div className="tip-title"> <div className="tip-title">