小程序
小游戏
企业微信
微信支付
扫描小程序码分享
将数据全部清除重新编译, 关闭都没有用,仍然进入fail
3 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
我采用的 简单有效 的 wx.getUserProfile 修改方法,这样不会超限
https://developers.weixin.qq.com/community/develop/article/doc/00000cc422c12844b4fb644d056813
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
以下代码复制( 可用,已测试)
XML片段
<button type="primary" open-type="getUserInfo" class="wx-login-btn" bindtap="wxLogin">微信授权登录</button>
js片段
wxLogin(){
wx.getUserProfile({
desc: '用于完善会员资料',
success: (res) => {
console.log(res)
//打印获取的信息
}
})
注意xml的代码。 必须是button 然后是open-type="getUserInfo" bindtap="wxLogin" 必须是bindtap
getUserProfile还有上限的吗,没遇到过,fail的报错贴来看看
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
我采用的 简单有效 的 wx.getUserProfile 修改方法,这样不会超限
https://developers.weixin.qq.com/community/develop/article/doc/00000cc422c12844b4fb644d056813
以下代码复制( 可用,已测试)
XML片段
<button type="primary" open-type="getUserInfo" class="wx-login-btn" bindtap="wxLogin">微信授权登录</button>
js片段
wxLogin(){
wx.getUserProfile({
desc: '用于完善会员资料',
success: (res) => {
console.log(res)
//打印获取的信息
}
})
}
注意xml的代码。 必须是button 然后是open-type="getUserInfo" bindtap="wxLogin" 必须是bindtap
你总不至于用户一进来你就让他重新登录无数次吧。
在token失效的时候,你才会重新去请求用户信息的数据,并非是频繁调用
getUserProfile还有上限的吗,没遇到过,fail的报错贴来看看
https://developers.weixin.qq.com/miniprogram/dev/framework/performance/api-frequency.html