diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/service/support/EmpUserServiceSupport.java b/modules/core/src/main/java/com/jeesite/modules/sys/service/support/EmpUserServiceSupport.java index 577e3885..8dbdb2ce 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/service/support/EmpUserServiceSupport.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/service/support/EmpUserServiceSupport.java @@ -27,7 +27,6 @@ import com.jeesite.modules.sys.utils.UserUtils; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; -import javax.annotation.PostConstruct; import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolationException; import java.util.List; @@ -49,16 +48,6 @@ public class EmpUserServiceSupport extends CrudService this.employeeService = employeeService; this.employeeOfficeDao = employeeOfficeDao; } - - /** - * 租户功能验证 - */ - @PostConstruct - private void corpModelValid() throws Exception{ - if (!Global.isUseCorpModel().equals(Global.getPropertyToBoolean("user.useCorpModel", "false"))){ - throw new Exception("\n\nuser.useCorpModel=true? 你开启了多租户模式,似乎你的当前版本不是JeeSite专业版。\n"); - } - } /** * 获取单条数据 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 918e3081..b8686e33 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 @@ -9,6 +9,7 @@ import com.jeesite.modules.sys.utils.UserUtils; import io.swagger.annotations.Api; import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -21,6 +22,7 @@ import javax.annotation.PostConstruct; * @version 20167-8-27 */ @Controller +@Lazy(false) @Api(tags = "Cache - 缓存管理") @RequestMapping(value = "${adminPath}/sys/cache") public class CacheController extends BaseController { @@ -38,15 +40,19 @@ public class CacheController extends BaseController { UserUtils.clearCache(); return renderResult(Global.TRUE, text("清理缓存成功")); } - + @PostConstruct - public void postConstruct(){ - String rebel = System.getProperty("rebel.base"); - if (StringUtils.isNotBlank(rebel) && Global - .getPropertyToBoolean("spring.cache.isClusterMode", "false")){ + public void postConstruct() throws Exception { + // 如果使用了 JRebel 插件,则清理缓存 + if (StringUtils.isNotBlank(System.getProperty("rebel.base")) && Global.getPropertyToBoolean("spring.cache.isClusterMode", "false")){ logger.info("JRebel: Cache clear..."); CacheUtils.clearCache(); } + // 则开启了租户参数,但无法使用,则给予提示 + if (!Global.isUseCorpModel().equals(Global.getPropertyToBoolean("user.useCorpModel", "false"))){ + throw new Exception("\n\nuser.useCorpModel=true? 你开启了多租户模式,似乎你的当前版本不是JeeSite专业版。\n"); + } } } +