fix 隐藏admin用户
This commit is contained in:
@@ -24,6 +24,7 @@ public class UserService : IUserService
|
||||
.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 => x.UserName != "admin")
|
||||
.WhereIF(request.Search.IsPresent(), (x, ur, r, c) => x.UserName == request.Search
|
||||
|| x.Email == request.Search
|
||||
|| x.PhoneNumber == request.Search
|
||||
@@ -53,7 +54,10 @@ public class UserService : IUserService
|
||||
|
||||
public async Task<List<UserResponse>> GetUsersAsync()
|
||||
{
|
||||
var users = await _dbContext.Queryable<UserEntity>().Select<UserResponse>().ToListAsync();
|
||||
var users = await _dbContext.Queryable<UserEntity>()
|
||||
.Where(x => x.UserName != "admin")
|
||||
.Select<UserResponse>()
|
||||
.ToListAsync();
|
||||
return users;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user