Browse Source

修复权限配置数据长度过大的bug

test
smallchill 6 years ago
parent
commit
6f07ea04d7
  1. 4
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantTreeVO.java
  2. 46
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantVO.java
  3. 8
      blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java

4
blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantTreeVO.java

@ -18,6 +18,7 @@ package org.springblade.system.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
@ -26,7 +27,8 @@ import java.util.List;
* @author Chill
*/
@Data
public class GrantTreeVO {
public class GrantTreeVO implements Serializable {
private static final long serialVersionUID = 1L;
private List<MenuVO> menu;

46
blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantVO.java

@ -0,0 +1,46 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package org.springblade.system.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* GrantVO
*
* @author Chill
*/
@Data
public class GrantVO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "roleIds集合")
private List<Long> roleIds;
@ApiModelProperty(value = "menuIds集合")
private List<Long> menuIds;
@ApiModelProperty(value = "dataScopeIds集合")
private List<Long> dataScopeIds;
@ApiModelProperty(value = "apiScopeIds集合")
private List<Long> apiScopeIds;
}

8
blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java

@ -30,6 +30,7 @@ import org.springblade.core.tool.node.INode;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.Role;
import org.springblade.system.service.IRoleService;
import org.springblade.system.vo.GrantVO;
import org.springblade.system.vo.RoleVO;
import org.springblade.system.wrapper.RoleWrapper;
import org.springframework.cache.annotation.CacheEvict;
@ -127,11 +128,8 @@ public class RoleController extends BladeController {
@ApiOperationSupport(order = 6)
@ApiOperation(value = "权限设置", notes = "传入roleId集合以及menuId集合")
@CacheEvict(cacheNames = {SYS_CACHE}, allEntries = true)
public R grant(@ApiParam(value = "roleId集合", required = true) @RequestParam String roleIds,
@ApiParam(value = "menuId集合", required = true) @RequestParam String menuIds,
@ApiParam(value = "dataScopeId集合") String dataScopeIds,
@ApiParam(value = "apiScopeId集合") String apiScopeIds) {
boolean temp = roleService.grant(Func.toLongList(roleIds), Func.toLongList(menuIds), Func.toLongList(dataScopeIds), Func.toLongList(apiScopeIds));
public R grant(@RequestBody GrantVO grantVO) {
boolean temp = roleService.grant(grantVO.getRoleIds(), grantVO.getMenuIds(), grantVO.getDataScopeIds(), grantVO.getApiScopeIds());
return R.status(temp);
}

Loading…
Cancel
Save