用这个方法 getUserProfile 提示 {errMsg: "getUserProfile:fail can only be invoked by user TAP gesture."}errMsg: "getUserProfile:fail can only be invoked by user TAP gesture."__proto__: Object
获取用户信息的方法 getUserProfile 么实现吗? 报如下错误{errMsg: "getUserProfile:fail can only be invoked by user TAP gesture."}errMsg: "getUserProfile:fail can only be invoked by user TAP gesture."__proto__: Object
https://developers.weixin.qq.com/community/develop/article/doc/000ae488458d201b838c45efe5bc13
就按wx.showModal一样处理。
一、判断本地存储是否有openid;
二、1.前端调用小程序api获取code并传给后端;
2.后端接收到code获取用户openid传给前端;
3.前端接收openid保存在localStorage内;
具体通过什么参数判断登录态视具体情况而定