mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-25 10:08:16 +08:00
#324: 修复分布式刷新access_token冲突问题
This commit is contained in:
parent
24fdf00977
commit
a15d8d77fb
@ -65,12 +65,7 @@ public class WxMpServiceApacheHttpClientImpl extends WxMpServiceAbstractImpl<Clo
|
|||||||
Lock lock = this.getWxMpConfigStorage().getAccessTokenLock();
|
Lock lock = this.getWxMpConfigStorage().getAccessTokenLock();
|
||||||
try {
|
try {
|
||||||
lock.lock();
|
lock.lock();
|
||||||
|
if (this.getWxMpConfigStorage().isAccessTokenExpired() || forceRefresh) {
|
||||||
if (forceRefresh) {
|
|
||||||
this.getWxMpConfigStorage().expireAccessToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.getWxMpConfigStorage().isAccessTokenExpired()) {
|
|
||||||
String url = String.format(WxMpService.GET_ACCESS_TOKEN_URL,
|
String url = String.format(WxMpService.GET_ACCESS_TOKEN_URL,
|
||||||
this.getWxMpConfigStorage().getAppId(), this.getWxMpConfigStorage().getSecret());
|
this.getWxMpConfigStorage().getAppId(), this.getWxMpConfigStorage().getSecret());
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user