增加微服务优化选项,可关闭一些不需要的功能开关,包括如下:1、可关闭根据模块状态去更新相连的菜单状态(menu.updateStatusByModuleStatus=false);
2、可关闭国际化管理(lang.enabled=false);3、可关闭任务调度功能(job.enabled=false);4、可关闭核心模块的Web功能(web.core.enabled=false);减少加载启动时间,控制在10秒内;
This commit is contained in:
@@ -8,6 +8,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -34,6 +35,7 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
|||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "${adminPath}/sys/area")
|
@RequestMapping(value = "${adminPath}/sys/area")
|
||||||
|
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||||
public class AreaController extends BaseController {
|
public class AreaController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -39,6 +40,7 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
|||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "${adminPath}/sys/company")
|
@RequestMapping(value = "${adminPath}/sys/company")
|
||||||
|
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||||
public class CompanyController extends BaseController {
|
public class CompanyController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
@@ -29,6 +30,7 @@ import com.jeesite.modules.sys.service.LogService;
|
|||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "${adminPath}/sys/log")
|
@RequestMapping(value = "${adminPath}/sys/log")
|
||||||
|
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||||
public class LogController extends BaseController {
|
public class LogController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -35,6 +36,7 @@ import com.jeesite.modules.sys.web.user.EmpUserController;
|
|||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "${adminPath}/sys/office")
|
@RequestMapping(value = "${adminPath}/sys/office")
|
||||||
|
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||||
public class OfficeController extends BaseController {
|
public class OfficeController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import org.apache.shiro.session.Session;
|
|||||||
import org.apache.shiro.subject.PrincipalCollection;
|
import org.apache.shiro.subject.PrincipalCollection;
|
||||||
import org.apache.shiro.subject.support.DefaultSubjectContext;
|
import org.apache.shiro.subject.support.DefaultSubjectContext;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -41,6 +42,7 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
|||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "${adminPath}/sys/online")
|
@RequestMapping(value = "${adminPath}/sys/online")
|
||||||
|
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||||
public class OnlineController extends BaseController{
|
public class OnlineController extends BaseController{
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -29,6 +30,7 @@ import com.jeesite.modules.sys.service.PostService;
|
|||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "${adminPath}/sys/post")
|
@RequestMapping(value = "${adminPath}/sys/post")
|
||||||
|
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||||
public class PostController extends BaseController {
|
public class PostController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import java.util.Map;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -34,6 +35,7 @@ import com.jeesite.modules.sys.utils.ValidCodeUtils;
|
|||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "/account")
|
@RequestMapping(value = "/account")
|
||||||
|
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||||
public class AccountController extends BaseController{
|
public class AccountController extends BaseController{
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -35,6 +36,7 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
|||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "${adminPath}/sys/corpAdmin")
|
@RequestMapping(value = "${adminPath}/sys/corpAdmin")
|
||||||
|
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||||
public class CorpAdminController extends BaseController {
|
public class CorpAdminController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import org.apache.shiro.authz.annotation.Logical;
|
|||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -54,6 +55,7 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
|||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "${adminPath}/sys/empUser")
|
@RequestMapping(value = "${adminPath}/sys/empUser")
|
||||||
|
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||||
public class EmpUserController extends BaseController {
|
public class EmpUserController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -32,6 +33,7 @@ import com.jeesite.modules.sys.service.UserService;
|
|||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "${adminPath}/sys/secAdmin")
|
@RequestMapping(value = "${adminPath}/sys/secAdmin")
|
||||||
|
@ConditionalOnProperty(name="web.core.enabled", havingValue="true", matchIfMissing=true)
|
||||||
public class SecAdminController extends BaseController {
|
public class SecAdminController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -179,9 +179,19 @@ user:
|
|||||||
registerUser:
|
registerUser:
|
||||||
enabled: false
|
enabled: false
|
||||||
userTypes: 0, 1
|
userTypes: 0, 1
|
||||||
|
|
||||||
|
# 菜单管理
|
||||||
|
menu:
|
||||||
|
# 根据模块状态去更新相连的菜单状态(仅作为微服务时设为false)
|
||||||
|
updateStatusByModuleStatus: true
|
||||||
|
|
||||||
|
# 国际化管理(专业版+)
|
||||||
|
lang:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
# 任务调度(个人版+)
|
# 任务调度(个人版+)
|
||||||
job:
|
job:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
# 是否自动启动任务调度(可关闭)
|
# 是否自动启动任务调度(可关闭)
|
||||||
autoStartup: true
|
autoStartup: true
|
||||||
@@ -396,6 +406,10 @@ web:
|
|||||||
validator:
|
validator:
|
||||||
id: '[a-zA-Z0-9_\-/\u4e00-\u9fa5]{0,64}'
|
id: '[a-zA-Z0-9_\-/\u4e00-\u9fa5]{0,64}'
|
||||||
user.loginCode: '[a-zA-Z0-9_\u4e00-\u9fa5]{4,20}'
|
user.loginCode: '[a-zA-Z0-9_\u4e00-\u9fa5]{4,20}'
|
||||||
|
|
||||||
|
# 关闭核心模块的Web功能(仅作为微服务时设为false)
|
||||||
|
core:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
# 错误页面500.html是否输出错误信息(正式环境,为提供安全性可设置为false)
|
# 错误页面500.html是否输出错误信息(正式环境,为提供安全性可设置为false)
|
||||||
error:
|
error:
|
||||||
|
|||||||
@@ -14,12 +14,6 @@ copyrightYear: 2018
|
|||||||
#是否演示模式
|
#是否演示模式
|
||||||
demoMode: false
|
demoMode: false
|
||||||
|
|
||||||
#是否小程序
|
|
||||||
miniService: true
|
|
||||||
|
|
||||||
#是否小程序
|
|
||||||
miniConfig: true
|
|
||||||
|
|
||||||
#============================#
|
#============================#
|
||||||
#===== Database sttings =====#
|
#===== Database sttings =====#
|
||||||
#============================#
|
#============================#
|
||||||
@@ -208,8 +202,18 @@ jdbc:
|
|||||||
# # 多租户模式(SAAS模式)(专业版)
|
# # 多租户模式(SAAS模式)(专业版)
|
||||||
# useCorpModel: false
|
# useCorpModel: false
|
||||||
|
|
||||||
|
# 菜单管理
|
||||||
|
#menu:
|
||||||
|
# # 根据模块状态去更新相连的菜单状态(仅作为微服务时设为false)
|
||||||
|
# updateStatusByModuleStatus: true
|
||||||
|
|
||||||
|
# 国际化管理(专业版+)
|
||||||
|
#lang:
|
||||||
|
# enabled: true
|
||||||
|
|
||||||
# 任务调度(个人版+)
|
# 任务调度(个人版+)
|
||||||
#job:
|
#job:
|
||||||
|
# enabled: true
|
||||||
#
|
#
|
||||||
# # 是否自动启动任务调度(可关闭)
|
# # 是否自动启动任务调度(可关闭)
|
||||||
# autoStartup: true
|
# autoStartup: true
|
||||||
@@ -385,6 +389,16 @@ jdbc:
|
|||||||
#
|
#
|
||||||
# # 静态文件后缀,排除的url路径,指定哪些uri路径不进行静态文件过滤。
|
# # 静态文件后缀,排除的url路径,指定哪些uri路径不进行静态文件过滤。
|
||||||
# staticFileExcludeUri: /druid/
|
# 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)
|
# 错误页面500.html是否输出错误信息(正式环境,为提供安全性可设置为false)
|
||||||
#error:
|
#error:
|
||||||
|
|||||||
Reference in New Issue
Block a user