修改参数配置时,先移除修改前缓存的配置,防止缓存错误数据
This commit is contained in:
parent
5a3714e9bc
commit
5b7a67037c
|
|
@ -1,9 +1,5 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import javax.annotation.PostConstruct;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
|
@ -13,6 +9,11 @@ import com.ruoyi.common.utils.StringUtils;
|
|||
import com.ruoyi.system.domain.SysConfig;
|
||||
import com.ruoyi.system.mapper.SysConfigMapper;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置 服务层实现
|
||||
|
|
@ -111,6 +112,11 @@ public class SysConfigServiceImpl implements ISysConfigService
|
|||
@Override
|
||||
public int updateConfig(SysConfig config)
|
||||
{
|
||||
SysConfig search = new SysConfig();
|
||||
search.setConfigId(config.getConfigId());
|
||||
search = configMapper.selectConfig(search);
|
||||
CacheUtils.remove(getCacheName(), getCacheKey(search.getConfigKey()));
|
||||
|
||||
int row = configMapper.updateConfig(config);
|
||||
if (row > 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue