uniapp获取微信小程序授权登录
/*修改this等于that*/
let that = this
/**
*进入正题,调用api获取用户授权
* 官方文档:https://uniapp.dcloud.io/api/plugins/login?id=getuserprofile
**/
uni.getUserProfile({
desc:"授权登录,仅获取头像,用户昵称展示权",
success(res){
console.log(res);
/*头像URL*/
that.imgsrc = res.userInfo.avatarUrl;
}
})
声明:本站原创文章文字版权归本站所有,转载务必注明作者和出处;本站转载文章仅仅代表原作者观点,不代表本站立场,图文版权归原作者所有。如有侵权,请联系我们删除。