1
0
mirror of synced 2025-12-23 02:18:07 +08:00

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

This commit is contained in:
Binary Wang
2017-08-26 20:16:30 +08:00
committed by Binary Wang
parent b79370ac60
commit 532c1af159
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 {