|
|
@ -34,10 +34,19 @@ public class WeChatNotifyController { |
|
|
|
*/ |
|
|
|
@PostMapping("componentaccesstoken") |
|
|
|
public Result getComponentAccessToken() { |
|
|
|
log.info("开始获取【component_access_token】......"); |
|
|
|
String accessTokenCountFlag = ModuleConstant.ACCOUNT_TOKEN_FLAG_TWO; |
|
|
|
componentVerifyTicketService.getComponentAccessToken(accessTokenCountFlag); |
|
|
|
log.info("已成功获取到【component_access_token】......"); |
|
|
|
RLock lock = null; |
|
|
|
try { |
|
|
|
lock = distributedLock.getLock("refresh_component_access_token"); |
|
|
|
log.info("开始获取【component_access_token】......"); |
|
|
|
String accessTokenCountFlag = ModuleConstant.ACCOUNT_TOKEN_FLAG_TWO; |
|
|
|
componentVerifyTicketService.getComponentAccessToken(accessTokenCountFlag); |
|
|
|
log.info("已成功获取到【component_access_token】......"); |
|
|
|
}catch (Exception e){ |
|
|
|
log.error("定时刷新component_access_token失败:".concat(ExceptionUtils.getErrorStackTrace(e))); |
|
|
|
throw e; |
|
|
|
}finally { |
|
|
|
distributedLock.unLock(lock); |
|
|
|
} |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|