{
!this.props.userInfo.country && (
<Block>
{
isUseProfile ? <Button className='auth-button' onClick={this.getUserInfoClick} /> :
<Button className='auth-button' openType='getUserInfo' onGetUserInfo={this.getUserInfoClick}></Button>
}
</Block>
)
}
getUserInfoClick = (e) => {
if(wx.getUserProfile) {
getUserInfo(res => {
console.log(res, '存了用户的昵称和头像')
this.props.login(res)
})
} else {
this.props.login(e.detail.userInfo)
}
}
可以的,https://mp.weixin.qq.com/s/LPqRBxLOUg3TNYp6wKckVA