华为手机调用wx.getUserProfile 报错
发布于 5 年前 作者 xiongli 11315 次浏览 来自 官方Issues

<button bindtap=“onKeyLogin”>授权登录</button>

onKeyLogin(e) {

		console.log("触发授权事件")

		wx.getUserProfile({

			desc:'同意授权',//不写不弹提示框

			success:function(resData){

				console.log("授权成功")

			},

		fail:function(err){

				console.log("授权失败")

			}

		})![](https://image.wxopen.club/content_b513af94-8956-11eb-a369-001a7dda7111.jpg)![](https://image.wxopen.club/content_b53517b4-8956-11eb-9d23-001a7dda7111.jpg)
4 回复

大兄弟 ~ 这个要四月份哦 还没有全面上线

getUserProfile可以正式使用了,我都改了好几个项目发布了,使用getUserProfile要满足基础库的要求,开发工具也要在1.05.2103112以上的,我是没加canIUse这些判断,直接就改了。

可以直接判断 wx.getUserProfile 有的话 说明可以使用

回到顶部