优化redis序列化代码
This commit is contained in:
+5
-7
@@ -5,6 +5,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
import org.springframework.security.oauth2.provider.token.TokenStore;
|
||||
|
||||
/**
|
||||
@@ -13,17 +14,14 @@ import org.springframework.security.oauth2.provider.token.TokenStore;
|
||||
*
|
||||
* @author zlt
|
||||
* @date 2018/7/25 9:36
|
||||
* <p>
|
||||
* Blog: https://zlt2000.gitee.io
|
||||
* Github: https://github.com/zlt2000
|
||||
*/
|
||||
@ConditionalOnProperty(prefix = "zlt.oauth2.token.store", name = "type", havingValue = "redis", matchIfMissing = true)
|
||||
public class AuthRedisTokenStore {
|
||||
@Autowired
|
||||
private RedisConnectionFactory connectionFactory;
|
||||
|
||||
@Autowired
|
||||
private SecurityProperties securityProperties;
|
||||
|
||||
@Bean
|
||||
public TokenStore tokenStore() {
|
||||
public TokenStore tokenStore(RedisConnectionFactory connectionFactory, SecurityProperties securityProperties) {
|
||||
return new CustomRedisTokenStore(connectionFactory, securityProperties);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user