fix 修复 CacheName 缓存key存储错误问题

feature/model
疯狂的狮子Li 1 year ago
parent a7586639ab
commit c616a55647

@ -118,6 +118,10 @@ public class PlusSpringCacheManager implements CacheManager {
@Override @Override
public Cache getCache(String name) { public Cache getCache(String name) {
// 重写 cacheName 支持多参数
String[] array = StringUtils.delimitedListToStringArray(name, "#");
name = array[0];
Cache cache = instanceMap.get(name); Cache cache = instanceMap.get(name);
if (cache != null) { if (cache != null) {
return cache; return cache;
@ -132,9 +136,6 @@ public class PlusSpringCacheManager implements CacheManager {
configMap.put(name, config); configMap.put(name, config);
} }
// 重写 cacheName 支持多参数
String[] array = StringUtils.delimitedListToStringArray(name, "#");
name = array[0];
if (array.length > 1) { if (array.length > 1) {
config.setTTL(DurationStyle.detectAndParse(array[1]).toMillis()); config.setTTL(DurationStyle.detectAndParse(array[1]).toMillis());
} }

Loading…
Cancel
Save