mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-06 12:45:22 +08:00
fix: qsso error bug
This commit is contained in:
parent
7653d07704
commit
72fc6e6d7c
@ -42,7 +42,7 @@ const HomeGuest = () => (
|
||||
</Col>
|
||||
<Col lg={15} xs={0} className="col-img">
|
||||
<div className="img-container">
|
||||
<img className="img" src={getImgPath('./image/demo-img', 'jpg')}/>
|
||||
<img className="img" src={getImgPath('/image/demo-img', 'jpg')} />
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
@ -172,8 +172,15 @@ class Home extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
if (this.props.login) {
|
||||
this.props.history.push('/group/261')
|
||||
}
|
||||
}
|
||||
|
||||
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 = {
|
||||
introList: PropTypes.array,
|
||||
@ -185,10 +192,9 @@ class Home extends Component {
|
||||
this.props.changeMenuItem('/group');
|
||||
}
|
||||
render() {
|
||||
const { login } = this.props;
|
||||
return (
|
||||
<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="container">
|
||||
<div className="tip-title">
|
||||
|
Loading…
Reference in New Issue
Block a user