mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-05-14 04:22:08 +08:00
代码优化
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user