修改名称

This commit is contained in:
wanggeng 2021-09-23 23:14:03 +08:00
parent ccf133f9ae
commit f3d386787b
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ public class OAuth2ClientTokenManager {
return oAuth2ClientTokenManager;
}
public AccessToken getAccessToken() {
public AccessToken getToken() {
if (accessToken == null || (System.currentTimeMillis() - accessToken.getCreateTime()) / 1000 >= accessToken.getExpiresIn()) {
LOG.debug("客户端Token失效获取token");
JSONObject accessTokenJsonObject = accessTokenRemoteService.getAccessToken(apiPathProperties.getUserCenter(), "client_credentials", oAuth2ClientProperties.getClient().getClientId(), oAuth2ClientProperties.getClient().getClientSecret(), "all");

View File

@ -41,6 +41,6 @@ public class OAuth2ClientStartUp implements ApplicationRunner {
@Scheduled(cron = "0 0/15 * * * ?")
public void refreshAccessToken() {
OAuth2ClientTokenManager.getInstance().getAccessToken();
OAuth2ClientTokenManager.getInstance().getToken();
}
}