代码优化

This commit is contained in:
shimingxy
2024-10-22 11:24:40 +08:00
parent c6dae02f41
commit e643352a2c
3 changed files with 21 additions and 21 deletions

View File

@@ -81,7 +81,7 @@ public class RemoteTokenServices implements ResourceServerTokenServices {
@Override
// Ignore 400
public void handleError(ClientHttpResponse response) throws IOException {
if (response.getRawStatusCode() != 400) {
if (response.getStatusCode().value() != 400) {
super.handleError(response);
}
}

View File

@@ -197,12 +197,12 @@ public class Oauth20AutoConfiguration implements InitializingBean {
RedisConnectionFactory redisConnFactory) {
_logger.debug("OAuth 2 Authorization Code Services init.");
AuthorizationCodeServices authorizationCodeServices = null;
if (persistence == ConstsPersistence.INMEMORY) {
authorizationCodeServices = new InMemoryAuthorizationCodeServices();
_logger.debug("InMemoryAuthorizationCodeServices");
} else if (persistence == ConstsPersistence.REDIS) {
if (persistence == ConstsPersistence.REDIS) {
authorizationCodeServices = new RedisAuthorizationCodeServices(redisConnFactory);
_logger.debug("RedisAuthorizationCodeServices");
}else {
authorizationCodeServices = new InMemoryAuthorizationCodeServices();
_logger.debug("InMemoryAuthorizationCodeServices");
}
return authorizationCodeServices;
}
@@ -218,12 +218,12 @@ public class Oauth20AutoConfiguration implements InitializingBean {
RedisConnectionFactory redisConnFactory) {
_logger.debug("OAuth 2 TokenStore init.");
TokenStore tokenStore = null;
if (persistence == ConstsPersistence.INMEMORY) {
tokenStore = new InMemoryTokenStore();
_logger.debug("InMemoryTokenStore");
} else if (persistence == ConstsPersistence.REDIS) {
if (persistence == ConstsPersistence.REDIS) {
tokenStore = new RedisTokenStore(redisConnFactory);
_logger.debug("RedisTokenStore");
}else {
tokenStore = new InMemoryTokenStore();
_logger.debug("InMemoryTokenStore");
}
return tokenStore;
}