wx.getUserProfile() 华为手机上面调用不起但是在开发者工具里面的真机测试又可以用?
发布于 4 年前 作者 jiehao 14692 次浏览 来自 官方Issues

wx.getStorage({ key: 'userInfo',

success (res) {

tools.showToast('成功',res)

that.userInfo = res.data;

that.getOpenId()

},

fail (err) {

tools.showToast('失败',err)

wx.getUserProfile({

desc: '正在获取', //不写不弹提示框

success: function (res) {

that.userInfo = res.userInfo;

wx.setStorage({ key: 'userInfo', data: res.userInfo });

that.getOpenId()

},

fail: function (err) {

console.log("获取失败: ", err)

}

})

}

});

回到顶部