feat 用户解锁
This commit is contained in:
@@ -100,6 +100,17 @@ public class UserService : IUserService
|
||||
var user = await _identityDbContext.Queryable<UserEntity>().Where(x => x.Id == request.UserId).Select<UserResponse>().FirstAsync();
|
||||
}
|
||||
|
||||
|
||||
public async Task UnlockAsync(int userId)
|
||||
{
|
||||
var user = await _identityDbContext.Queryable<UserEntity>().SingleAsync(x => x.Id == userId);
|
||||
user.ThrowIfNull("用户不存在");
|
||||
|
||||
user.LockoutEnd = null;
|
||||
|
||||
await _identityDbContext.UpdateAsync(user);
|
||||
}
|
||||
|
||||
public async Task<List<UserResponse>> GetUserByIdsAsync(List<int> ids)
|
||||
{
|
||||
return await _identityDbContext.Queryable<UserEntity>()
|
||||
|
||||
Reference in New Issue
Block a user