mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-21 02:25:56 +08:00
redission处理判断无前缀则不处理
This commit is contained in:
parent
fa31d23226
commit
65786c70a7
@ -139,7 +139,7 @@ spring:
|
|||||||
|
|
||||||
redisson:
|
redisson:
|
||||||
# redis key前缀
|
# redis key前缀
|
||||||
keyPrefix: ruoyi-vue-plus
|
keyPrefix:
|
||||||
# 线程池数量
|
# 线程池数量
|
||||||
threads: 4
|
threads: 4
|
||||||
# Netty线程池数量
|
# Netty线程池数量
|
||||||
|
|||||||
@ -142,7 +142,7 @@ spring:
|
|||||||
|
|
||||||
redisson:
|
redisson:
|
||||||
# redis key前缀
|
# redis key前缀
|
||||||
keyPrefix: ruoyi-vue-plus
|
keyPrefix:
|
||||||
# 线程池数量
|
# 线程池数量
|
||||||
threads: 16
|
threads: 16
|
||||||
# Netty线程池数量
|
# Netty线程池数量
|
||||||
|
|||||||
@ -12,8 +12,9 @@ public class KeyPrefixHandler implements NameMapper {
|
|||||||
|
|
||||||
private final String keyPrefix;
|
private final String keyPrefix;
|
||||||
|
|
||||||
|
//前缀为空 则返回空前缀
|
||||||
public KeyPrefixHandler(String keyPrefix) {
|
public KeyPrefixHandler(String keyPrefix) {
|
||||||
this.keyPrefix = keyPrefix + ":";
|
this.keyPrefix = StringUtils.isBlank(keyPrefix) ? "" : keyPrefix + ":";
|
||||||
}
|
}
|
||||||
|
|
||||||
//增加前缀
|
//增加前缀
|
||||||
@ -22,6 +23,9 @@ public class KeyPrefixHandler implements NameMapper {
|
|||||||
if (StringUtils.isBlank(name)) {
|
if (StringUtils.isBlank(name)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isBlank(keyPrefix)) {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
if (!name.startsWith(keyPrefix)) {
|
if (!name.startsWith(keyPrefix)) {
|
||||||
return keyPrefix + name;
|
return keyPrefix + name;
|
||||||
} else {
|
} else {
|
||||||
@ -35,6 +39,9 @@ public class KeyPrefixHandler implements NameMapper {
|
|||||||
if (StringUtils.isBlank(name)) {
|
if (StringUtils.isBlank(name)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isBlank(keyPrefix)) {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
if (name.startsWith(keyPrefix)) {
|
if (name.startsWith(keyPrefix)) {
|
||||||
return name.substring(keyPrefix.length());
|
return name.substring(keyPrefix.length());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user