mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-06-28 13:16:19 +08:00
🐛 #1276 修复微信开放平台获取授权列表接口token参数导致死循环的问题
WxOpenComponentServiceImpl#getAuthorizerList由post内部维护token,否则总是使用旧token导致死循环
This commit is contained in:
parent
e7a0d6a597
commit
2e14b5479e
@ -27,7 +27,7 @@ public interface WxOpenComponentService {
|
|||||||
String API_GET_AUTHORIZER_INFO_URL = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info";
|
String API_GET_AUTHORIZER_INFO_URL = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info";
|
||||||
String API_GET_AUTHORIZER_OPTION_URL = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_option";
|
String API_GET_AUTHORIZER_OPTION_URL = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_option";
|
||||||
String API_SET_AUTHORIZER_OPTION_URL = "https://api.weixin.qq.com/cgi-bin/component/api_set_authorizer_option";
|
String API_SET_AUTHORIZER_OPTION_URL = "https://api.weixin.qq.com/cgi-bin/component/api_set_authorizer_option";
|
||||||
String API_GET_AUTHORIZER_LIST = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_list?component_access_token=%s";
|
String API_GET_AUTHORIZER_LIST = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_list";
|
||||||
|
|
||||||
String COMPONENT_LOGIN_PAGE_URL = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s&auth_type=xxx&biz_appid=xxx";
|
String COMPONENT_LOGIN_PAGE_URL = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s&auth_type=xxx&biz_appid=xxx";
|
||||||
|
|
||||||
|
@ -304,16 +304,13 @@ public class WxOpenComponentServiceImpl implements WxOpenComponentService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WxOpenAuthorizerListResult getAuthorizerList(int begin, int len) throws WxErrorException {
|
public WxOpenAuthorizerListResult getAuthorizerList(int begin, int len) throws WxErrorException {
|
||||||
|
|
||||||
String url = String.format(API_GET_AUTHORIZER_LIST, getComponentAccessToken(false));
|
|
||||||
begin = begin < 0 ? 0 : begin;
|
begin = begin < 0 ? 0 : begin;
|
||||||
len = len == 0 ? 10 : len;
|
len = len == 0 ? 10 : len;
|
||||||
|
|
||||||
JsonObject jsonObject = new JsonObject();
|
JsonObject jsonObject = new JsonObject();
|
||||||
jsonObject.addProperty("component_appid", getWxOpenConfigStorage().getComponentAppId());
|
jsonObject.addProperty("component_appid", getWxOpenConfigStorage().getComponentAppId());
|
||||||
jsonObject.addProperty("offset", begin);
|
jsonObject.addProperty("offset", begin);
|
||||||
jsonObject.addProperty("count", len);
|
jsonObject.addProperty("count", len);
|
||||||
String responseContent = post(url, jsonObject.toString());
|
String responseContent = post(API_GET_AUTHORIZER_LIST, jsonObject.toString());
|
||||||
WxOpenAuthorizerListResult ret = WxOpenGsonBuilder.create().fromJson(responseContent, WxOpenAuthorizerListResult.class);
|
WxOpenAuthorizerListResult ret = WxOpenGsonBuilder.create().fromJson(responseContent, WxOpenAuthorizerListResult.class);
|
||||||
if (ret != null && ret.getList() != null) {
|
if (ret != null && ret.getList() != null) {
|
||||||
for (Map<String, String> data : ret.getList()) {
|
for (Map<String, String> data : ret.getList()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user