jinxia.mo 4 недель назад
Родитель
Сommit
586793997f

+ 12 - 3
ie-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java

@@ -2,6 +2,8 @@ package com.ruoyi.web.controller.system;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import jdk.nashorn.api.scripting.AbstractJSObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
@@ -24,7 +26,7 @@ import com.ruoyi.system.service.ISysConfigService;
 
 /**
  * 参数配置 信息操作处理
- * 
+ *
  * @author ruoyi
  */
 @RestController
@@ -88,7 +90,10 @@ public class SysConfigController extends BaseController
             return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
         }
         config.setCreateBy(getUsername());
-        return toAjax(configService.insertConfig(config));
+        configService.insertConfig(config);
+
+        configService.resetConfigCache();
+        return AjaxResult.success();
     }
 
     /**
@@ -104,7 +109,10 @@ public class SysConfigController extends BaseController
             return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
         }
         config.setUpdateBy(getUsername());
-        return toAjax(configService.updateConfig(config));
+        configService.updateConfig(config);
+
+        configService.resetConfigCache();
+        return AjaxResult.success();
     }
 
     /**
@@ -116,6 +124,7 @@ public class SysConfigController extends BaseController
     public AjaxResult remove(@PathVariable Long[] configIds)
     {
         configService.deleteConfigByIds(configIds);
+        configService.resetConfigCache();
         return success();
     }