From f728af68e0e095191698c8d6a53b146a316311ec Mon Sep 17 00:00:00 2001 From: smallchill Date: Fri, 8 Mar 2019 22:48:25 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../springblade/system/controller/DeptController.java | 8 ++++---- .../springblade/system/controller/RoleController.java | 10 +++++----- .../system/service/impl/TenantServiceImpl.java | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java index cd7b24b8..65e890e8 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java +++ b/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> tree(@RequestParam(defaultValue = BladeConstant.ADMIN_TENANT_CODE) String tenantCode) { - List tree = deptService.tree(tenantCode); + public R> tree(String tenantCode, BladeUser bladeUser) { + List 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))); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java index eb467c59..4e32e8c6 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java +++ b/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> tree(@RequestParam(defaultValue = BladeConstant.ADMIN_TENANT_CODE) String tenantCode) { - List tree = roleService.tree(tenantCode); + public R> tree(String tenantCode, BladeUser bladeUser) { + List 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)); diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java index d4068463..2df02eb4 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java @@ -65,7 +65,7 @@ public class TenantServiceImpl extends BaseServiceImpl imp // 新建租户对应的默认角色 Role role = new Role(); role.setTenantCode(tenantCode); - role.setParentId(1); + role.setParentId(0); role.setRoleName("管理员"); role.setRoleAlias("admin"); role.setSort(2);