#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

@@ -51,11 +51,7 @@ public class WxMpServiceJoddHttpImpl extends WxMpServiceAbstractImpl<HttpConnect
try {
lock.lock();
if (forceRefresh) {
this.getWxMpConfigStorage().expireAccessToken();
}
if (this.getWxMpConfigStorage().isAccessTokenExpired()) {
if (this.getWxMpConfigStorage().isAccessTokenExpired() || forceRefresh) {
String url = String.format(WxMpService.GET_ACCESS_TOKEN_URL,
this.getWxMpConfigStorage().getAppId(), this.getWxMpConfigStorage().getSecret());

View File

@@ -43,11 +43,7 @@ public class WxMpServiceOkHttpImpl extends WxMpServiceAbstractImpl<OkHttpClient,
try {
lock.lock();
if (forceRefresh) {
this.getWxMpConfigStorage().expireAccessToken();
}
if (this.getWxMpConfigStorage().isAccessTokenExpired()) {
if (this.getWxMpConfigStorage().isAccessTokenExpired() || forceRefresh) {
String url = String.format(WxMpService.GET_ACCESS_TOKEN_URL,
this.getWxMpConfigStorage().getAppId(), this.getWxMpConfigStorage().getSecret());