From b2eceed94346a3b5a1cf49f3c018682021faa4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Sat, 7 Oct 2023 15:48:30 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=88=96=E7=BC=96=E8=BE=91=20SysOssConfig=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=90=8E=20=E6=8E=A8=E9=80=81=E5=88=B0=20redis=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=8D=E5=AE=8C=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dromara/system/service/impl/SysOssConfigServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssConfigServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssConfigServiceImpl.java index 730ad063..be4ed039 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssConfigServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssConfigServiceImpl.java @@ -102,6 +102,8 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { validEntityBeforeSave(config); boolean flag = baseMapper.insert(config) > 0; if (flag) { + // 从数据库查询完整的数据做缓存 + config = baseMapper.selectById(config.getOssConfigId()); CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); } return flag; @@ -119,6 +121,8 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService { luw.eq(SysOssConfig::getOssConfigId, config.getOssConfigId()); boolean flag = baseMapper.update(config, luw) > 0; if (flag) { + // 从数据库查询完整的数据做缓存 + config = baseMapper.selectById(config.getOssConfigId()); CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); } return flag;