mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-21 02:25:56 +08:00
fixed:修复了 当用户在表单中修改了某个参数配置,但是缓存没有刷新,导致selectConfigByKey方法会获取到redis里的历史值的问题
This commit is contained in:
parent
71317201b8
commit
0546bc11f3
@ -139,7 +139,8 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
|
|||||||
int row = 0;
|
int row = 0;
|
||||||
if (config.getConfigId() != null) {
|
if (config.getConfigId() != null) {
|
||||||
SysConfig temp = baseMapper.selectById(config.getConfigId());
|
SysConfig temp = baseMapper.selectById(config.getConfigId());
|
||||||
if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) {
|
//老的configKey ,和新的configKey 同, 那说明configValue可能发生了改变,需要清除缓存,否则#selectConfigByKey方法会获取到redis里面的老值
|
||||||
|
if (StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) {
|
||||||
CacheUtils.evict(CacheNames.SYS_CONFIG, temp.getConfigKey());
|
CacheUtils.evict(CacheNames.SYS_CONFIG, temp.getConfigKey());
|
||||||
}
|
}
|
||||||
row = baseMapper.updateById(config);
|
row = baseMapper.updateById(config);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user