|
|
@@ -160,6 +160,10 @@ public class RoleController {
|
|
|
@PutMapping
|
|
|
@ApiOperation(value = "修改角色")
|
|
|
public R update(@Valid @RequestBody UpdateRoleDto dto) {
|
|
|
+ Role byId = roleService.getById(dto.getId());
|
|
|
+ if(byId.getIsSystem() != null && byId.getIsSystem() == 1){
|
|
|
+ return R.error("系统角色不能修改!");
|
|
|
+ }
|
|
|
if (dto.getId().equals(GlobalConstant.SUPER_ADMIN_ROLE_ID)) {
|
|
|
return R.error("超级管理员角色不能修改!");
|
|
|
}
|
|
|
@@ -172,6 +176,7 @@ public class RoleController {
|
|
|
if (count > 0) {
|
|
|
return R.error("角色名称或编码已存在!");
|
|
|
}
|
|
|
+
|
|
|
Role role = BeanUtil.toBean(dto, Role.class);
|
|
|
roleService.updateById(role);
|
|
|
CompletableFuture.runAsync(() -> {
|