Browse Source

bug修复

test
smallchill 6 years ago
parent
commit
f728af68e0
  1. 8
      blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java
  2. 10
      blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java
  3. 2
      blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java

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

@ -84,8 +84,8 @@ public class DeptController extends BladeController {
*/
@GetMapping("/tree")
@ApiOperation(value = "树形结构", notes = "树形结构", position = 3)
public R<List<DeptVO>> tree(@RequestParam(defaultValue = BladeConstant.ADMIN_TENANT_CODE) String tenantCode) {
List<DeptVO> tree = deptService.tree(tenantCode);
public R<List<DeptVO>> tree(String tenantCode, BladeUser bladeUser) {
List<DeptVO> tree = deptService.tree(Func.toStr(tenantCode, bladeUser.getTenantCode()));
return R.data(tree);
}
@ -93,7 +93,7 @@ public class DeptController extends BladeController {
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperation(value = "新增或修改", notes = "传入dept", position = 6)
@ApiOperation(value = "新增或修改", notes = "传入dept", position = 4)
public R submit(@Valid @RequestBody Dept dept, BladeUser user) {
if (Func.isEmpty(dept.getId())) {
dept.setTenantCode(user.getTenantCode());
@ -105,7 +105,7 @@ public class DeptController extends BladeController {
* 删除
*/
@PostMapping("/remove")
@ApiOperation(value = "删除", notes = "传入ids", position = 7)
@ApiOperation(value = "删除", notes = "传入ids", position = 5)
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(deptService.removeByIds(Func.toIntList(ids)));
}

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

@ -82,8 +82,8 @@ public class RoleController extends BladeController {
*/
@GetMapping("/tree")
@ApiOperation(value = "树形结构", notes = "树形结构", position = 3)
public R<List<RoleVO>> tree(@RequestParam(defaultValue = BladeConstant.ADMIN_TENANT_CODE) String tenantCode) {
List<RoleVO> tree = roleService.tree(tenantCode);
public R<List<RoleVO>> tree(String tenantCode, BladeUser bladeUser) {
List<RoleVO> tree = roleService.tree(Func.toStr(tenantCode, bladeUser.getTenantCode()));
return R.data(tree);
}
@ -91,7 +91,7 @@ public class RoleController extends BladeController {
* 新增或修改
*/
@PostMapping("/submit")
@ApiOperation(value = "新增或修改", notes = "传入role", position = 6)
@ApiOperation(value = "新增或修改", notes = "传入role", position = 4)
public R submit(@Valid @RequestBody Role role, BladeUser user) {
if (Func.isEmpty(role.getId())) {
role.setTenantCode(user.getTenantCode());
@ -104,7 +104,7 @@ public class RoleController extends BladeController {
* 删除
*/
@PostMapping("/remove")
@ApiOperation(value = "删除", notes = "传入ids", position = 7)
@ApiOperation(value = "删除", notes = "传入ids", position = 5)
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(roleService.removeByIds(Func.toIntList(ids)));
}
@ -117,7 +117,7 @@ public class RoleController extends BladeController {
* @return
*/
@PostMapping("/grant")
@ApiOperation(value = "权限设置", notes = "传入roleId集合以及menuId集合", position = 7)
@ApiOperation(value = "权限设置", notes = "传入roleId集合以及menuId集合", position = 6)
public R grant(@ApiParam(value = "roleId集合", required = true) @RequestParam String roleIds,
@ApiParam(value = "menuId集合", required = true) @RequestParam String menuIds) {
boolean temp = roleService.grant(Func.toIntList(roleIds), Func.toIntList(menuIds));

2
blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java

@ -65,7 +65,7 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
// 新建租户对应的默认角色
Role role = new Role();
role.setTenantCode(tenantCode);
role.setParentId(1);
role.setParentId(0);
role.setRoleName("管理员");
role.setRoleAlias("admin");
role.setSort(2);

Loading…
Cancel
Save