html52.com
我爱小程序-开发者交流社区

2021年4月28日24时,基础库版本很低的使getUserInfo还能获取到用户的昵称和头像么 ?

{
    !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)
    }
}


网友回复

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付