mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-15 18:55:13 +08:00
#324: 修复分布式刷新access_token冲突问题
This commit is contained in:
@@ -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());
|
||||
|
||||
|
@@ -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());
|
||||
|
||||
|
Reference in New Issue
Block a user