mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-09-19 18:22:15 +08:00
修改插件名称:sa-token-dao-redis-string -> sa-token-dao-redis-fastjson
This commit is contained in:
@@ -21,8 +21,8 @@
|
|||||||
<module>sa-token-alone-redis</module>
|
<module>sa-token-alone-redis</module>
|
||||||
<module>sa-token-dao-redis</module>
|
<module>sa-token-dao-redis</module>
|
||||||
<module>sa-token-dao-redis-jackson</module>
|
<module>sa-token-dao-redis-jackson</module>
|
||||||
|
<module>sa-token-dao-redis-fastjson</module>
|
||||||
<module>sa-token-dao-redisx</module>
|
<module>sa-token-dao-redisx</module>
|
||||||
<module>sa-token-dao-redis-string</module>
|
|
||||||
<module>sa-token-dialect-thymeleaf</module>
|
<module>sa-token-dialect-thymeleaf</module>
|
||||||
<module>sa-token-sso</module>
|
<module>sa-token-sso</module>
|
||||||
<module>sa-token-oauth2</module>
|
<module>sa-token-oauth2</module>
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>sa-token-dao-redix-string</artifactId>
|
<artifactId>sa-token-dao-redis-fastjson</artifactId>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- sa-token-spring-boot-starter -->
|
<!-- sa-token-spring-boot-starter -->
|
@@ -21,7 +21,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class SaTokenDaoRedisString implements SaTokenDao {
|
public class SaTokenDaoRedisFastjson implements SaTokenDao {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* String专用
|
* String专用
|
||||||
@@ -29,7 +29,7 @@ public class SaTokenDaoRedisString implements SaTokenDao {
|
|||||||
public StringRedisTemplate stringRedisTemplate;
|
public StringRedisTemplate stringRedisTemplate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Objecy专用
|
* Object专用
|
||||||
*/
|
*/
|
||||||
public StringRedisTemplate objectRedisTemplate;
|
public StringRedisTemplate objectRedisTemplate;
|
||||||
|
|
||||||
@@ -40,6 +40,11 @@ public class SaTokenDaoRedisString implements SaTokenDao {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public void init(RedisConnectionFactory connectionFactory) {
|
public void init(RedisConnectionFactory connectionFactory) {
|
||||||
|
// 不重复初始化
|
||||||
|
if(this.isInit) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 指定相应的序列化方案
|
// 指定相应的序列化方案
|
||||||
StringRedisSerializer keySerializer = new StringRedisSerializer();
|
StringRedisSerializer keySerializer = new StringRedisSerializer();
|
||||||
StringRedisSerializer valueSerializer = new StringRedisSerializer();
|
StringRedisSerializer valueSerializer = new StringRedisSerializer();
|
||||||
@@ -57,11 +62,9 @@ public class SaTokenDaoRedisString implements SaTokenDao {
|
|||||||
template.afterPropertiesSet();
|
template.afterPropertiesSet();
|
||||||
|
|
||||||
// 开始初始化相关组件
|
// 开始初始化相关组件
|
||||||
if(!this.isInit) {
|
this.stringRedisTemplate = stringTemplate;
|
||||||
this.stringRedisTemplate = stringTemplate;
|
this.objectRedisTemplate = template;
|
||||||
this.objectRedisTemplate = template;
|
this.isInit = true;
|
||||||
this.isInit = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@@ -1 +1 @@
|
|||||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.dev33.satoken.dao.SaTokenDaoRedisString
|
org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.dev33.satoken.dao.SaTokenDaoRedisFastjson
|
@@ -69,6 +69,10 @@ public class SaTokenDaoRedisJackson implements SaTokenDao {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public void init(RedisConnectionFactory connectionFactory) {
|
public void init(RedisConnectionFactory connectionFactory) {
|
||||||
|
// 不重复初始化
|
||||||
|
if(this.isInit) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 指定相应的序列化方案
|
// 指定相应的序列化方案
|
||||||
StringRedisSerializer keySerializer = new StringRedisSerializer();
|
StringRedisSerializer keySerializer = new StringRedisSerializer();
|
||||||
@@ -112,11 +116,9 @@ public class SaTokenDaoRedisJackson implements SaTokenDao {
|
|||||||
template.afterPropertiesSet();
|
template.afterPropertiesSet();
|
||||||
|
|
||||||
// 开始初始化相关组件
|
// 开始初始化相关组件
|
||||||
if(this.isInit == false) {
|
this.stringRedisTemplate = stringTemplate;
|
||||||
this.stringRedisTemplate = stringTemplate;
|
this.objectRedisTemplate = template;
|
||||||
this.objectRedisTemplate = template;
|
this.isInit = true;
|
||||||
this.isInit = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -41,6 +41,11 @@ public class SaTokenDaoRedis implements SaTokenDao {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public void init(RedisConnectionFactory connectionFactory) {
|
public void init(RedisConnectionFactory connectionFactory) {
|
||||||
|
// 不重复初始化
|
||||||
|
if(this.isInit) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 指定相应的序列化方案
|
// 指定相应的序列化方案
|
||||||
StringRedisSerializer keySerializer = new StringRedisSerializer();
|
StringRedisSerializer keySerializer = new StringRedisSerializer();
|
||||||
JdkSerializationRedisSerializer valueSerializer = new JdkSerializationRedisSerializer();
|
JdkSerializationRedisSerializer valueSerializer = new JdkSerializationRedisSerializer();
|
||||||
@@ -58,11 +63,9 @@ public class SaTokenDaoRedis implements SaTokenDao {
|
|||||||
template.afterPropertiesSet();
|
template.afterPropertiesSet();
|
||||||
|
|
||||||
// 开始初始化相关组件
|
// 开始初始化相关组件
|
||||||
if(this.isInit == false) {
|
this.stringRedisTemplate = stringTemplate;
|
||||||
this.stringRedisTemplate = stringTemplate;
|
this.objectRedisTemplate = template;
|
||||||
this.objectRedisTemplate = template;
|
this.isInit = true;
|
||||||
this.isInit = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user