通过userid查询用户信息新增查询用户所有角色

This commit is contained in:
不做码农
2022-01-06 12:36:18 +08:00
parent cf3f86b06a
commit a996ab1d22
4 changed files with 8 additions and 8 deletions

View File

@@ -51,7 +51,12 @@ namespace ZR.Service
/// <returns></returns>
public SysUser SelectUserById(long userId)
{
return UserRepository.SelectUserById(userId);
var user = UserRepository.SelectUserById(userId);
if (user != null && user.UserId > 0)
{
user.Roles = RoleService.SelectUserRoleListByUserId(userId);
}
return user;
}
/// <summary>