微信小程序授权官方说明文档
uniapp微信小程序授权登录
<button open-type="getUserInfo" @getuserinfo="bindGetUserInfo" >授权登录</button>
methods: {
bindGetUserInfo(e) {
if (e.detail.userInfo){
console.log(111)
//用户按了允许授权按钮
} else {
console.log(222)
//用户按了拒绝按钮
}
},
}
uniapp微信小程序授权地理位置(打开manifest.json,添加permission属性)
/* 小程序特有相关 */
"mp-weixin" :
{
"appid" : "wxbb47121088a4a253",
"setting" :
{
"urlCheck" : false
},
"usingComponents" : true,
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
},
参考链接下方