收藏
回答

在使用获取微信token凭证使用stable_token方法后,每次都提示失效

框架类型 问题类型 操作时间 AppID
小程序 Bug 2025-10-24 wx931f74f11c694341
//api.weixin.qq.com/cgi-bin/stable_token
获取过来的token,存起来后, 第一次走后续的业务,能发送消息成功
后续从缓存中获取toen后,马上就提示:}


{"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest, could get access_token by getStableAccessToken, more details at https://mmbizurl.cn/s/JtxxFh33r rid: 68faede9-4dc6e1c6-2287f2c6"}

可我都已经是使用了getStableAccessToken接口了哦,咋还是说token失效或者不是最新的token

String wx_new_token_url = "https://api.weixin.qq.com/cgi-bin/stable_token";

Map<String, Object> params = new HashMap<>();

                params.put("grant_type", "client_credential");

                params.put("appid", appId);

                params.put("secret", secret);

//                params.put("force_refresh",true);

                String result = HTTPClient.doPost(wx_new_token_url, JSON.toJSONString(params));

回答关注问题邀请回答
收藏

1 个回答

  • 智能回答 智能回答 本次回答由AI生成
    2025-10-24
    有用
登录 后发表内容