收藏
回答

wx.getUserProfile 获取用户信息

   <button bindtap="getUserProfile">登录 / 获取头像昵称</button> 


wx.getUserProfile({
            desc: '用于展示用户信息',
            success: (res) => {
                console.log('用户信息:', res.userInfo)
                this.setData({
                    userInfo: res.userInfo,
                    hasUserInfo: true
                })
            },
            fail: () => {
                wx.showToast({
                    title: '用户拒绝授权',
                    icon: 'none'
                })
            }
        })


通过该方式获取用户信息怎么获取来的都是默认数据
回答关注问题邀请回答
收藏

5 个回答

登录 后发表内容