wx.getUserProfile({
desc: '展示用户信息',
success: (userRes) => { this.handleWechatLogin(userRes.userInfo);
}, fail: (err) => {
console.error('getUserProfile 失败原因:', err.errMsg);
} } });
} 发现 desc改长一点 比如“用于完善您的会员资料,展示个人信息”就会报错:getUserProfile:fail desc length does not meet the requirements,
如果 改为 "展示用户信息" 不报错 但是获取到的是用户的默认头像和昵称

现在可以通过昵称头像填写能力,让用户完善昵称和头像
https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/userProfile.html
不能。这个接口目前已经废弃
我用这个,挺方便,一键获取真实头像和昵称
https://blog.csdn.net/think_about_it/article/details/148851745
为什么有赞还可以获取头像和昵称呢,看样子是用H5做的,也不知道是怎么实现的。
不能