diff --git a/zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/AuthRedisTokenStore.java b/zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/AuthRedisTokenStore.java
index a865158949277b5ebb60f81bc9d89dbc94633a95..ec4f3111f81cd23d9c267e63b2f7b7955608a1ea 100644
--- a/zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/AuthRedisTokenStore.java
+++ b/zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/AuthRedisTokenStore.java
@@ -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
+ *
+ * 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);
}
}
diff --git a/zlt-commons/zlt-redis-spring-boot-starter/src/main/java/com/central/common/redis/RedisAutoConfigure.java b/zlt-commons/zlt-redis-spring-boot-starter/src/main/java/com/central/common/redis/RedisAutoConfigure.java
index 3bc5e5b82fe5436484f8681eb7d6b73086c2eeb1..33b755f25e20294e1ebc062839b92751d51d180d 100644
--- a/zlt-commons/zlt-redis-spring-boot-starter/src/main/java/com/central/common/redis/RedisAutoConfigure.java
+++ b/zlt-commons/zlt-redis-spring-boot-starter/src/main/java/com/central/common/redis/RedisAutoConfigure.java
@@ -1,11 +1,8 @@
package com.central.common.redis;
import com.central.common.redis.properties.CacheManagerProperties;
-import com.central.common.redis.template.RedisRepository;
-import com.central.common.redis.util.RedisObjectSerializer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.interceptor.KeyGenerator;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.CacheManager;
@@ -27,6 +24,9 @@ import java.util.Map;
*
* @author zlt
* @date 2018/11/6 11:02
+ *
+ * Blog: https://zlt2000.gitee.io
+ * Github: https://github.com/zlt2000
*/
@EnableConfigurationProperties({RedisProperties.class, CacheManagerProperties.class})
@EnableCaching
@@ -34,35 +34,45 @@ public class RedisAutoConfigure {
@Autowired
private CacheManagerProperties cacheManagerProperties;
+ @Bean
+ public RedisSerializer redisKeySerializer() {
+ return RedisSerializer.string();
+ }
+
+ @Bean
+ public RedisSerializer