|
|
|
@ -58,6 +58,8 @@ export class Main extends React.Component< |
|
|
|
|
userId:string; |
|
|
|
|
//显示欢迎信息
|
|
|
|
|
result:boolean; |
|
|
|
|
//打开个人信息变化提示
|
|
|
|
|
changeTip:JSX.Element|null; |
|
|
|
|
} |
|
|
|
|
>{ |
|
|
|
|
|
|
|
|
@ -77,7 +79,8 @@ export class Main extends React.Component< |
|
|
|
|
result:Boolean(this.props.cookies.get(welcome_cookie)), |
|
|
|
|
userType:this.props.cookies.get(user_type_cookie), |
|
|
|
|
userId:this.props.cookies.get(user_cookie), |
|
|
|
|
timeScore:this.props.cookies.get(time_score) |
|
|
|
|
timeScore:this.props.cookies.get(time_score), |
|
|
|
|
changeTip:null |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -204,6 +207,11 @@ export class Main extends React.Component< |
|
|
|
|
this.props.cookies.remove(welcome_cookie) |
|
|
|
|
}}/> |
|
|
|
|
|
|
|
|
|
<MyDialog content={this.state.changeTip} open={this.state.changeTip!==null} titleId='change-user-dialog' |
|
|
|
|
menuName='个人信息刷新提示' onClose={()=>this.setState({ |
|
|
|
|
changeTip:null |
|
|
|
|
})}/> |
|
|
|
|
|
|
|
|
|
{this.state.subMenu} |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
@ -216,10 +224,18 @@ export class Main extends React.Component< |
|
|
|
|
private refreshInfo(value:any) { |
|
|
|
|
if('userType' in value) { |
|
|
|
|
this.props.cookies.set(user_type_cookie, value.userType) |
|
|
|
|
this.setState({ |
|
|
|
|
userType:value.userType, |
|
|
|
|
changeTip:<h3 className='text-center text-info'>已刷新用户身份</h3> |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if('timeScore' in value){ |
|
|
|
|
this.props.cookies.set(time_score,value.timeScore) |
|
|
|
|
this.setState({ |
|
|
|
|
userType:value.userType, |
|
|
|
|
changeTip:<h3 className='text-center text-info'>已刷新时间币</h3> |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.setState(value) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|