收藏
回答

wx.getUserProfile调用无返回数据?

getUserProfile(e) {
    // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
    // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
    wx.getUserProfile({
      desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
      success: (res) => {
        this.setData({
          userInfo: res.userInfo,
          hasUserInfo: true
        })
      }
    })
  },

直接调用getUserProfile方法 wx.getUserProfile 无返回数据,无响应。。

使用button触发getUserProfile方法,wx.getUserProfile有数据返回。why?????????

<button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>


*开发工具已更新,确认支持wx.getUserProfile接口。

回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容
问题标签