Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix develop 微信开放平台获取授权列表token导致死循环问题 #1276

Merged
merged 1 commit into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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_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_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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,13 @@ public WxOpenAuthorizerInfoResult getAuthorizerInfo(String authorizerAppid) thro

@Override
public WxOpenAuthorizerListResult getAuthorizerList(int begin, int len) throws WxErrorException {

String url = String.format(API_GET_AUTHORIZER_LIST, getComponentAccessToken(false));
begin = begin < 0 ? 0 : begin;
len = len == 0 ? 10 : len;

JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("component_appid", getWxOpenConfigStorage().getComponentAppId());
jsonObject.addProperty("offset", begin);
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);
if (ret != null && ret.getList() != null) {
for (Map<String, String> data : ret.getList()) {
Expand Down