refactor: 用户分配角色

V0.5.x
jay 2023-06-12 15:09:58 +08:00
parent 84e8f7c27d
commit 6d4446e786
2 changed files with 4 additions and 4 deletions

View File

@ -91,7 +91,7 @@ public class SysRoleDataImpl implements ISysRoleData, IJPACommData<SysRole, Long
@Override
public List<SysRole> selectRolePermissionByUserId(Long userId) {
return buildQueryTitle(PredicateBuilder.instance()
.and(tbSysRole.delFlag.eq("0"))
.and(tbSysRole.delFlag.eq(UserConstants.NORMAL))
.and(tbSysUserRole.userId.eq(userId))
.build());
}

View File

@ -237,12 +237,12 @@ public class SysUserController extends BaseController {
/**
*
*
* @param userId ID
*/
@ApiOperation("根据用户编号获取授权角色")
@SaCheckPermission("system:user:query")
@PostMapping("/authRole/{userId}")
public SysUserInfoVo authRole(@PathVariable Long userId) {
@PostMapping("/authRoleByUserId")
public SysUserInfoVo authRole(@Validated @RequestBody Request<Long> bo) {
Long userId = bo.getData();
SysUserVo user = userService.selectUserById(userId);
List<SysRoleVo> roles = roleService.selectRolesByUserId(userId);
SysUserInfoVo userInfoVo = new SysUserInfoVo();