- 小程序发放公众号创建的会员卡,真机调试一直报addCard:fail cancel?
小程序调用addCard 代码片段 // 组织扩展参数 let cardExt = { timestamp: res.data.timestamp, //时间戳,以秒为单位 nonce_str: res.data.nonceStr, //随机字符串 signature: res.data.signature //签名 } if (typeof wx.addCard === 'function' ) { // 领取 wx.addCard({ cardList: [{ cardId: res.data.cardId, cardExt: JSON.stringify(cardExt), }], success(res) { console.log(res.cardList) // 卡券添加结果 }, fail(err) { console.log(err) } }); 签名已使用工具校验过是正确的,会员卡不是自定义code码,也没有指定某个人领取,所以没传code和openid,真机调试就返回 addCard:fail cancel,根本不知道哪里有问题啊 微信版本:8.0.24 基础库:2.25.1 [图片]
2022-07-18 - java获取小程序直播间列表 一直返回40001 token失效?
错误信息:{"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest rid: 60483f26-519a08bf-746c3560"} access_token是后端维护的 有效期内不会重复获取 拉取缓存直接使用; 已尝试的方法: 1、修改小程序APP_SECRET 并重新获取token —— 无效! 2、使用调试工具生成token,在java后台使用 —— 无效! APPID: wx550ef6bf14bd26e5 代码片段: // 拉取直播间列表 String url = "https://api.weixin.qq.com/wxa/business/getliveinfo?access_token=" + getAccessToken(tenantId, "WECHAT"); Map paras = new HashMap(); paras.put("start", pageable.getPageNumber() * pageable.getPageSize()); paras.put("limit", pageable.getPageSize()); String result = MiniHttpUtil.post(url, paras, "");
2021-03-10