From b195480441804f636c003e56943ac6e73439ccea Mon Sep 17 00:00:00 2001 From: thinkgem Date: Sun, 19 Aug 2018 11:05:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BE=AE=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=89=E9=A1=B9=EF=BC=8C=E5=8F=AF=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E4=B8=80=E4=BA=9B=E4=B8=8D=E9=9C=80=E8=A6=81=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=BC=80=E5=85=B3=EF=BC=8C=E5=8C=85=E6=8B=AC?= =?UTF-8?q?=E5=A6=82=E4=B8=8B=EF=BC=9A1=E3=80=81=E5=8F=AF=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E6=A0=B9=E6=8D=AE=E6=A8=A1=E5=9D=97=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8E=BB=E6=9B=B4=E6=96=B0=E7=9B=B8=E8=BF=9E=E7=9A=84=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81=EF=BC=88menu.updateStatusByModuleSt?= =?UTF-8?q?atus=3Dfalse=EF=BC=89=EF=BC=9B=202=E3=80=81=E5=8F=AF=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=9B=BD=E9=99=85=E5=8C=96=E7=AE=A1=E7=90=86=EF=BC=88?= =?UTF-8?q?lang.enabled=3Dfalse=EF=BC=89=EF=BC=9B3=E3=80=81=E5=8F=AF?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E4=BB=BB=E5=8A=A1=E8=B0=83=E5=BA=A6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=88job.enabled=3Dfalse=EF=BC=89=EF=BC=9B4?= =?UTF-8?q?=E3=80=81=E5=8F=AF=E5=85=B3=E9=97=AD=E6=A0=B8=E5=BF=83=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E7=9A=84Web=E5=8A=9F=E8=83=BD=EF=BC=88web.core.enable?= =?UTF-8?q?d=3Dfalse=EF=BC=89=EF=BC=9B=E5=87=8F=E5=B0=91=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=97=B6=E9=97=B4=EF=BC=8C=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=9C=A810=E7=A7=92=E5=86=85=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/sys/web/AreaController.java | 2 ++ .../modules/sys/web/CompanyController.java | 2 ++ .../modules/sys/web/LogController.java | 2 ++ .../modules/sys/web/OfficeController.java | 2 ++ .../modules/sys/web/OnlineController.java | 2 ++ .../modules/sys/web/PostController.java | 2 ++ .../sys/web/user/AccountController.java | 2 ++ .../sys/web/user/CorpAdminController.java | 2 ++ .../sys/web/user/EmpUserController.java | 2 ++ .../sys/web/user/SecAdminController.java | 2 ++ .../main/resources/config/jeesite-core.yml | 14 ++++++++++ web/src/main/resources/config/jeesite.yml | 26 ++++++++++++++----- 12 files changed, 54 insertions(+), 6 deletions(-) diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/web/AreaController.java b/modules/core/src/main/java/com/jeesite/modules/sys/web/AreaController.java index f9619b28..6d85547e 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/web/AreaController.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/web/AreaController.java @@ -8,6 +8,7 @@ import java.util.Map; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.annotation.Validated; @@ -34,6 +35,7 @@ import com.jeesite.modules.sys.utils.UserUtils; */ @Controller @RequestMapping(value = "${adminPath}/sys/area") +@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true) public class AreaController extends BaseController { @Autowired diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/web/CompanyController.java b/modules/core/src/main/java/com/jeesite/modules/sys/web/CompanyController.java index e4b7315d..49582dae 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/web/CompanyController.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/web/CompanyController.java @@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletResponse; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.annotation.Validated; @@ -39,6 +40,7 @@ import com.jeesite.modules.sys.utils.UserUtils; */ @Controller @RequestMapping(value = "${adminPath}/sys/company") +@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true) public class CompanyController extends BaseController { @Autowired diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/web/LogController.java b/modules/core/src/main/java/com/jeesite/modules/sys/web/LogController.java index d9b6c135..1a580679 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/web/LogController.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/web/LogController.java @@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; @@ -29,6 +30,7 @@ import com.jeesite.modules.sys.service.LogService; */ @Controller @RequestMapping(value = "${adminPath}/sys/log") +@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true) public class LogController extends BaseController { @Autowired diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/web/OfficeController.java b/modules/core/src/main/java/com/jeesite/modules/sys/web/OfficeController.java index ce8db414..84e76f9e 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/web/OfficeController.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/web/OfficeController.java @@ -8,6 +8,7 @@ import java.util.Map; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.annotation.Validated; @@ -35,6 +36,7 @@ import com.jeesite.modules.sys.web.user.EmpUserController; */ @Controller @RequestMapping(value = "${adminPath}/sys/office") +@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true) public class OfficeController extends BaseController { @Autowired diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/web/OnlineController.java b/modules/core/src/main/java/com/jeesite/modules/sys/web/OnlineController.java index db6b014d..a76a9b9f 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/web/OnlineController.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/web/OnlineController.java @@ -17,6 +17,7 @@ import org.apache.shiro.session.Session; import org.apache.shiro.subject.PrincipalCollection; import org.apache.shiro.subject.support.DefaultSubjectContext; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; @@ -41,6 +42,7 @@ import com.jeesite.modules.sys.utils.UserUtils; */ @Controller @RequestMapping(value = "${adminPath}/sys/online") +@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true) public class OnlineController extends BaseController{ @Autowired diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/web/PostController.java b/modules/core/src/main/java/com/jeesite/modules/sys/web/PostController.java index e83f2d30..56bda545 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/web/PostController.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/web/PostController.java @@ -8,6 +8,7 @@ import javax.servlet.http.HttpServletResponse; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.annotation.Validated; @@ -29,6 +30,7 @@ import com.jeesite.modules.sys.service.PostService; */ @Controller @RequestMapping(value = "${adminPath}/sys/post") +@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true) public class PostController extends BaseController { @Autowired diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/web/user/AccountController.java b/modules/core/src/main/java/com/jeesite/modules/sys/web/user/AccountController.java index 2d1ebec9..4d7174d4 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/web/user/AccountController.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/web/user/AccountController.java @@ -9,6 +9,7 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PostMapping; @@ -34,6 +35,7 @@ import com.jeesite.modules.sys.utils.ValidCodeUtils; */ @Controller @RequestMapping(value = "/account") +@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true) public class AccountController extends BaseController{ @Autowired diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/web/user/CorpAdminController.java b/modules/core/src/main/java/com/jeesite/modules/sys/web/user/CorpAdminController.java index 2eef3266..cd2bb132 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/web/user/CorpAdminController.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/web/user/CorpAdminController.java @@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.annotation.Validated; @@ -35,6 +36,7 @@ import com.jeesite.modules.sys.utils.UserUtils; */ @Controller @RequestMapping(value = "${adminPath}/sys/corpAdmin") +@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true) public class CorpAdminController extends BaseController { @Autowired diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/web/user/EmpUserController.java b/modules/core/src/main/java/com/jeesite/modules/sys/web/user/EmpUserController.java index da832d53..420ef9f3 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/web/user/EmpUserController.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/web/user/EmpUserController.java @@ -13,6 +13,7 @@ import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.annotation.Validated; @@ -54,6 +55,7 @@ import com.jeesite.modules.sys.utils.UserUtils; */ @Controller @RequestMapping(value = "${adminPath}/sys/empUser") +@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true) public class EmpUserController extends BaseController { @Autowired diff --git a/modules/core/src/main/java/com/jeesite/modules/sys/web/user/SecAdminController.java b/modules/core/src/main/java/com/jeesite/modules/sys/web/user/SecAdminController.java index 7e529a38..06f37029 100644 --- a/modules/core/src/main/java/com/jeesite/modules/sys/web/user/SecAdminController.java +++ b/modules/core/src/main/java/com/jeesite/modules/sys/web/user/SecAdminController.java @@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.annotation.Validated; @@ -32,6 +33,7 @@ import com.jeesite.modules.sys.service.UserService; */ @Controller @RequestMapping(value = "${adminPath}/sys/secAdmin") +@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true) public class SecAdminController extends BaseController { @Autowired diff --git a/modules/core/src/main/resources/config/jeesite-core.yml b/modules/core/src/main/resources/config/jeesite-core.yml index 39a19a13..f1875be0 100644 --- a/modules/core/src/main/resources/config/jeesite-core.yml +++ b/modules/core/src/main/resources/config/jeesite-core.yml @@ -179,9 +179,19 @@ user: registerUser: enabled: false userTypes: 0, 1 + +# 菜单管理 +menu: + # 根据模块状态去更新相连的菜单状态(仅作为微服务时设为false) + updateStatusByModuleStatus: true + +# 国际化管理(专业版+) +lang: + enabled: true # 任务调度(个人版+) job: + enabled: true # 是否自动启动任务调度(可关闭) autoStartup: true @@ -396,6 +406,10 @@ web: validator: id: '[a-zA-Z0-9_\-/\u4e00-\u9fa5]{0,64}' user.loginCode: '[a-zA-Z0-9_\u4e00-\u9fa5]{4,20}' + + # 关闭核心模块的Web功能(仅作为微服务时设为false) + core: + enabled: true # 错误页面500.html是否输出错误信息(正式环境,为提供安全性可设置为false) error: diff --git a/web/src/main/resources/config/jeesite.yml b/web/src/main/resources/config/jeesite.yml index e61a2aac..5212ba54 100644 --- a/web/src/main/resources/config/jeesite.yml +++ b/web/src/main/resources/config/jeesite.yml @@ -14,12 +14,6 @@ copyrightYear: 2018 #是否演示模式 demoMode: false -#是否小程序 -miniService: true - -#是否小程序 -miniConfig: true - #============================# #===== Database sttings =====# #============================# @@ -208,8 +202,18 @@ jdbc: # # 多租户模式(SAAS模式)(专业版) # useCorpModel: false +# 菜单管理 +#menu: +# # 根据模块状态去更新相连的菜单状态(仅作为微服务时设为false) +# updateStatusByModuleStatus: true + +# 国际化管理(专业版+) +#lang: +# enabled: true + # 任务调度(个人版+) #job: +# enabled: true # # # 是否自动启动任务调度(可关闭) # autoStartup: true @@ -385,6 +389,16 @@ jdbc: # # # 静态文件后缀,排除的url路径,指定哪些uri路径不进行静态文件过滤。 # staticFileExcludeUri: /druid/ +# +# # 自定义正则表达式验证(主键、登录名) +# validator: +# id: '[a-zA-Z0-9_\-/\u4e00-\u9fa5]{0,64}' +# user.loginCode: '[a-zA-Z0-9_\u4e00-\u9fa5]{4,20}' +# +# # 关闭核心模块的Web功能(仅作为微服务时设为false) +# core: +# enabled: true + # # 错误页面500.html是否输出错误信息(正式环境,为提供安全性可设置为false) #error: