2021年4月28日24时,基础库版本很低的使getUserInfo还能获取到用户的昵称和头像么 ?
发布于 6 年前 作者 yejie 14947 次浏览 来自 问答
{
    !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)
    }
}

回到顶部