Commit a719baaa by wangshuo

登录问题

parent 58dbde32
...@@ -142,10 +142,11 @@ class BlessingPreheat extends Component { ...@@ -142,10 +142,11 @@ class BlessingPreheat extends Component {
} }
handleToShow = (key, isLogin = false) => { handleToShow = (key, isLogin = false) => {
const { history } = this.props; const { userInfo } = this.state;
if(isLogin) { // 需要用户登录 并且用户未登录
if(isLogin && !userInfo.isLogin) {
this.toLogin(); this.toLogin();
}else { }else{
let obj = {}; let obj = {};
obj[key] = true; obj[key] = true;
this.setState({ this.setState({
...@@ -399,7 +400,7 @@ class BlessingPreheat extends Component { ...@@ -399,7 +400,7 @@ class BlessingPreheat extends Component {
<div className="test__record" onClick={() => this.handleToShow('showRecordList', true)}> <div className="test__record" onClick={() => this.handleToShow('showRecordList', true)}>
测试记录> 测试记录>
</div> </div>
<LevelTest isLogin={userInfo.isLogin} toLogin={this.toLogin}></LevelTest> <LevelTest history={history} isLogin={userInfo.isLogin} toLogin={this.toLogin}></LevelTest>
<RankList></RankList> <RankList></RankList>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment