From ae06748457d16f2651ed426c69c200a50d949bf1 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Mon, 15 Jul 2019 14:12:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E4=BD=BF=E7=94=A8=20JRebel=20?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=90=AF=E5=8A=A8=E9=A1=B9=E7=9B=AE=E5=90=8E?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=B8=85=E7=90=86=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jeesite/modules/sys/web/CacheController.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/web/CacheController.java b/modules/core/src/main/java/com/jeesite/modules/sys/web/CacheController.java index 8bcca791..dd84816e 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/web/CacheController.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/web/CacheController.java @@ -1,5 +1,7 @@ package com.jeesite.modules.sys.web; +import javax.annotation.PostConstruct; + import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -7,6 +9,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import com.jeesite.common.cache.CacheUtils; import com.jeesite.common.config.Global; +import com.jeesite.common.lang.StringUtils; import com.jeesite.common.web.BaseController; import com.jeesite.modules.sys.utils.UserUtils; @@ -32,5 +35,14 @@ public class CacheController extends BaseController { Global.clearCache(); return renderResult(Global.TRUE, "清理缓存成功!"); } + + @PostConstruct + public void postConstruct(){ + String rebel = System.getProperty("rebel.base"); + if (StringUtils.isNotBlank(rebel)){ + logger.debug("JRebel: 清理系统缓存..."); + CacheUtils.clearCache(); + } + } }