getUserProfile 获取用户信息?

小程序 文章 2022-03-04 17:20 542 0 全屏看文

AI助手支持GPT4.0

getUserProfile 获取用户信息?getUserProfile Get user information?

getUserProfile 获取用户信息?
  //用户授权登陆微信  getUserProfilefunction (e{    var that = this    console.log(e.detail.errMsg)    console.log(e.detail.userInfo)    console.log(e.detail.rawData)    wx.getUserProfile({      desc'用于完善会员资料'// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写      success(res) => {        if (e.detail.errMsg == 'getUserProfile:ok') {          wx.setStorageSync('UserInfo', e.detail.userInfo)          wx.setStorageSync('GotUserInfo'true)          that.setData({            GotUserInfohiddentrue          })        } else {          this.setData({            GotUserInfohiddenfalse          })          wx.showToast({            title'请登陆!',            icon'loading',            duration2000          })        }      }    })  },


求高手帮看下,获取不了用户信息

/ / the user is authorized to log in to wechat {getuserprofile: function (E) {var} that = this} console.log (e.detail. Errmsg) console.log (e.detail. Userinfo) console.log (e.detail. Rawdata) wx.getuserprofile( {desc: 'used to improve the member profile', / / declare the purpose of obtaining the user's personal information, which will be displayed in the pop-up window later. Please fill in carefully {success: (RES) = > {if (e.detail. Errmsg = ='getuserprofile: OK ') {wx.setstoragesync ('userinfo', e.detail. Userinfo) wx.setstoragesync ('GotUserInfo', true)          that. setData({            GotUserInfohidden: true          })        } else {          this.setData({            GotUserInfohidden: false          })          wx. Showtoast ({Title: 'please log in!', Icon: 'loading', duration: 2000})}}}}}}. Ask an expert to help you. You can't get the user information

回答:

xxxidream:

errMsg的判断应该不需要

C:那应该怎么判断 ,前端<input>和<button> 在同一位置,同时显示一个
刘绵绵是仙女:

是不是这个的问题

刘绵绵是仙女:
C:没太明白什么意思?
Mr.Zhao:

自己帮自己,打印下res看看

-EOF-

AI助手支持GPT4.0