使用的方式错了,这个应该是使用调用api的方式。
官方也有案例
https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserProfile.html
参考:
<view bindtap="getUserInfo">获取用户信息</view>
getUserInfo() {
wx.getUserProfile({
desc: "用于更好的展示。",
success: (res) =>{
console.log(res);
},
})
}
你打印错了吧,下面才是成功回调函数