#324: 修复分布式刷新access_token冲突问题

This commit is contained in:
Binary Wang
2017-08-26 20:16:30 +08:00
parent a15d8d77fb
commit a6b29af33a
6 changed files with 6 additions and 27 deletions

View File

@@ -87,11 +87,7 @@ public class WxMaServiceImpl implements WxMaService, RequestHttp<CloseableHttpCl
try {
lock.lock();
if (forceRefresh) {
this.getWxMaConfig().expireAccessToken();
}
if (this.getWxMaConfig().isAccessTokenExpired()) {
if (this.getWxMaConfig().isAccessTokenExpired() || forceRefresh) {
String url = String.format(WxMaService.GET_ACCESS_TOKEN_URL, this.getWxMaConfig().getAppid(),
this.getWxMaConfig().getSecret());
try {