Skip to content

Commit eb6b09c

Browse files
007gzsbinarywang
authored andcommitted
#1119 开放平台模块getAuthorizerList方法里自动刷新refreshToken
1 parent 55ce138 commit eb6b09c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenComponentServiceImpl.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,17 @@ public WxOpenAuthorizerListResult getAuthorizerList(int begin, int len) throws W
313313
jsonObject.addProperty("offset", begin);
314314
jsonObject.addProperty("count", len);
315315
String responseContent = post(url, jsonObject.toString());
316-
return WxOpenGsonBuilder.create().fromJson(responseContent, WxOpenAuthorizerListResult.class);
316+
WxOpenAuthorizerListResult ret = WxOpenGsonBuilder.create().fromJson(responseContent, WxOpenAuthorizerListResult.class);
317+
if(ret != null && ret.getList() != null){
318+
for(Map<String, String> data : ret.getList()){
319+
String authorizerAppid = data.get("authorizer_appid");
320+
String refreshToken = data.get("refresh_token");
321+
if(authorizerAppid != null && refreshToken != null){
322+
this.getWxOpenConfigStorage().setAuthorizerRefreshToken(authorizerAppid, refreshToken);
323+
}
324+
}
325+
}
326+
return ret;
317327
}
318328

319329
@Override

0 commit comments

Comments
 (0)