增加web严格模式 web.strictMode=false(更严格的数据安全验证,如isAll=true这种参数形式将被禁用)
This commit is contained in:
@@ -63,7 +63,7 @@ public class AreaController extends BaseController {
|
|||||||
* 查询区域数据
|
* 查询区域数据
|
||||||
* @param area
|
* @param area
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("user")
|
@RequiresPermissions("sys:area:view")
|
||||||
@RequestMapping(value = "listData")
|
@RequestMapping(value = "listData")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<Area> listData(Area area) {
|
public List<Area> listData(Area area) {
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class CompanyController extends BaseController {
|
|||||||
* 查询公司数据
|
* 查询公司数据
|
||||||
* @param company
|
* @param company
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("user")
|
@RequiresPermissions("sys:company:view")
|
||||||
@RequestMapping(value = "listData")
|
@RequestMapping(value = "listData")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<Company> listData(Company company, String ctrlPermi) {
|
public List<Company> listData(Company company, String ctrlPermi) {
|
||||||
@@ -209,7 +209,7 @@ public class CompanyController extends BaseController {
|
|||||||
List<Map<String, Object>> mapList = ListUtils.newArrayList();
|
List<Map<String, Object>> mapList = ListUtils.newArrayList();
|
||||||
Company where = new Company();
|
Company where = new Company();
|
||||||
where.setStatus(Company.STATUS_NORMAL);
|
where.setStatus(Company.STATUS_NORMAL);
|
||||||
if (!(isAll != null && isAll)){
|
if (!(isAll != null && isAll) || Global.isStrictMode()){
|
||||||
companyService.addDataScopeFilter(where, ctrlPermi);
|
companyService.addDataScopeFilter(where, ctrlPermi);
|
||||||
}
|
}
|
||||||
List<Company> list = companyService.findList(where);
|
List<Company> list = companyService.findList(where);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonView;
|
||||||
import com.jeesite.common.codec.DesUtils;
|
import com.jeesite.common.codec.DesUtils;
|
||||||
import com.jeesite.common.config.Global;
|
import com.jeesite.common.config.Global;
|
||||||
import com.jeesite.common.lang.StringUtils;
|
import com.jeesite.common.lang.StringUtils;
|
||||||
@@ -344,6 +345,7 @@ public class LoginController extends BaseController{
|
|||||||
@RequiresPermissions("user")
|
@RequiresPermissions("user")
|
||||||
@RequestMapping(value = "menuTree")
|
@RequestMapping(value = "menuTree")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
@JsonView(Menu.SimpleView.class)
|
||||||
public List<Menu> menuTree(String parentCode) {
|
public List<Menu> menuTree(String parentCode) {
|
||||||
if (StringUtils.isNotBlank(parentCode)){
|
if (StringUtils.isNotBlank(parentCode)){
|
||||||
return UserUtils.getMenuListByParentCode(parentCode);
|
return UserUtils.getMenuListByParentCode(parentCode);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class OfficeController extends BaseController {
|
|||||||
* 查询机构数据
|
* 查询机构数据
|
||||||
* @param office
|
* @param office
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("user")
|
@RequiresPermissions("sys:company:view")
|
||||||
@RequestMapping(value = "listData")
|
@RequestMapping(value = "listData")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<Office> listData(Office office, String ctrlPermi) {
|
public List<Office> listData(Office office, String ctrlPermi) {
|
||||||
@@ -222,7 +222,7 @@ public class OfficeController extends BaseController {
|
|||||||
Office where = new Office();
|
Office where = new Office();
|
||||||
where.setStatus(Office.STATUS_NORMAL);
|
where.setStatus(Office.STATUS_NORMAL);
|
||||||
where.setCompanyCode(companyCode);
|
where.setCompanyCode(companyCode);
|
||||||
if (!(isAll != null && isAll)){
|
if (!(isAll != null && isAll) || Global.isStrictMode()){
|
||||||
officeService.addDataScopeFilter(where, ctrlPermi);
|
officeService.addDataScopeFilter(where, ctrlPermi);
|
||||||
}
|
}
|
||||||
List<Office> list = officeService.findList(where);
|
List<Office> list = officeService.findList(where);
|
||||||
|
|||||||
@@ -131,7 +131,6 @@ public class PostController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取岗位树结构数据
|
* 获取岗位树结构数据
|
||||||
* @param isAll 是否显示所有机构(true:不进行权限过滤)
|
|
||||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class EmpUserController extends BaseController {
|
|||||||
public Page<EmpUser> listData(EmpUser empUser, Boolean isAll, String ctrlPermi, HttpServletRequest request, HttpServletResponse response) {
|
public Page<EmpUser> listData(EmpUser empUser, Boolean isAll, String ctrlPermi, HttpServletRequest request, HttpServletResponse response) {
|
||||||
empUser.getEmployee().getOffice().setIsQueryChildren(true);
|
empUser.getEmployee().getOffice().setIsQueryChildren(true);
|
||||||
empUser.getEmployee().getCompany().setIsQueryChildren(true);
|
empUser.getEmployee().getCompany().setIsQueryChildren(true);
|
||||||
if (!(isAll != null && isAll)){
|
if (!(isAll != null && isAll) || Global.isStrictMode()){
|
||||||
empUserService.addDataScopeFilter(empUser, ctrlPermi);
|
empUserService.addDataScopeFilter(empUser, ctrlPermi);
|
||||||
}
|
}
|
||||||
empUser.setPage(new Page<>(request, response));
|
empUser.setPage(new Page<>(request, response));
|
||||||
@@ -175,7 +175,7 @@ public class EmpUserController extends BaseController {
|
|||||||
public void exportData(EmpUser empUser, Boolean isAll, String ctrlPermi, HttpServletResponse response) {
|
public void exportData(EmpUser empUser, Boolean isAll, String ctrlPermi, HttpServletResponse response) {
|
||||||
empUser.getEmployee().getOffice().setIsQueryChildren(true);
|
empUser.getEmployee().getOffice().setIsQueryChildren(true);
|
||||||
empUser.getEmployee().getCompany().setIsQueryChildren(true);
|
empUser.getEmployee().getCompany().setIsQueryChildren(true);
|
||||||
if (!(isAll != null && isAll)){
|
if (!(isAll != null && isAll) || Global.isStrictMode()){
|
||||||
empUserService.addDataScopeFilter(empUser, ctrlPermi);
|
empUserService.addDataScopeFilter(empUser, ctrlPermi);
|
||||||
}
|
}
|
||||||
List<EmpUser> list = empUserService.findList(empUser);
|
List<EmpUser> list = empUserService.findList(empUser);
|
||||||
@@ -367,7 +367,7 @@ public class EmpUserController extends BaseController {
|
|||||||
empUser.setRoleCode(roleCode);
|
empUser.setRoleCode(roleCode);
|
||||||
empUser.setStatus(User.STATUS_NORMAL);
|
empUser.setStatus(User.STATUS_NORMAL);
|
||||||
empUser.setUserType(User.USER_TYPE_EMPLOYEE);
|
empUser.setUserType(User.USER_TYPE_EMPLOYEE);
|
||||||
if (!(isAll != null && isAll)) {
|
if (!(isAll != null && isAll) || Global.isStrictMode()) {
|
||||||
empUserService.addDataScopeFilter(empUser, ctrlPermi);
|
empUserService.addDataScopeFilter(empUser, ctrlPermi);
|
||||||
}
|
}
|
||||||
List<EmpUser> list = empUserService.findList(empUser);
|
List<EmpUser> list = empUserService.findList(empUser);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class SecAdminController extends BaseController {
|
|||||||
return "modules/sys/user/secAdminList";
|
return "modules/sys/user/secAdminList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("user")
|
@RequiresPermissions("sys:secAdmin:view")
|
||||||
@RequestMapping(value = "listData")
|
@RequestMapping(value = "listData")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Page<User> listData(User user, HttpServletRequest request, HttpServletResponse response) {
|
public Page<User> listData(User user, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|||||||
@@ -48,6 +48,8 @@
|
|||||||
if($('.sidebar-menu').length == 1){
|
if($('.sidebar-menu').length == 1){
|
||||||
$(window).trigger("hashchange");
|
$(window).trigger("hashchange");
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
location = '${ctx}/login';
|
||||||
}
|
}
|
||||||
}, 'html');
|
}, 'html');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -476,6 +476,9 @@ logging:
|
|||||||
# # 静态资源路径前缀,可做CDN加速优化
|
# # 静态资源路径前缀,可做CDN加速优化
|
||||||
# staticPrefix: /static
|
# staticPrefix: /static
|
||||||
#
|
#
|
||||||
|
# # 严格模式(更严格的数据安全验证)
|
||||||
|
# strictMode: false
|
||||||
|
#
|
||||||
# # 自定义正则表达式验证(主键、登录名)
|
# # 自定义正则表达式验证(主键、登录名)
|
||||||
# validator:
|
# validator:
|
||||||
# id: '[a-zA-Z0-9_\-/#\u4e00-\u9fa5]{0,64}'
|
# id: '[a-zA-Z0-9_\-/#\u4e00-\u9fa5]{0,64}'
|
||||||
|
|||||||
Reference in New Issue
Block a user