add 操作人
This commit is contained in:
@@ -90,7 +90,7 @@ public class UserService : IUserService
|
||||
Role = r.Name,
|
||||
OperatorName = c.ClaimValue,
|
||||
}, true)
|
||||
.FirstAsync();
|
||||
.SingleAsync();
|
||||
|
||||
return user;
|
||||
}
|
||||
@@ -102,8 +102,19 @@ public class UserService : IUserService
|
||||
|
||||
public async Task<List<UserResponse>> GetUserByIdsAsync(List<int> ids)
|
||||
{
|
||||
var users = await _identityDbContext.Queryable<UserEntity>().Where(x => ids.Contains(x.Id)).Select<UserResponse>().ToListAsync();
|
||||
return users;
|
||||
return await _identityDbContext.Queryable<UserEntity>()
|
||||
.LeftJoin<UserRoleEntity>((x, ur) => x.Id == ur.UserId)
|
||||
.LeftJoin<RoleEntity>((x, ur, r) => ur.RoleId == r.Id)
|
||||
.LeftJoin<UserClaimEntity>((x, ur, r, c) => x.Id == c.UserId && c.ClaimType == "preferred_username")
|
||||
.Where(x => ids.Contains(x.Id))
|
||||
.Select((x, ur, r, c) => new UserResponse
|
||||
{
|
||||
Id = x.Id,
|
||||
RoleId = ur.RoleId,
|
||||
Role = r.Name,
|
||||
OperatorName = c.ClaimValue,
|
||||
}, true)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task CreateUserAsync(UserCreateRequest request)
|
||||
|
||||
Reference in New Issue
Block a user