feat 用户解锁

This commit is contained in:
2025-05-13 09:57:22 +08:00
parent c2b97024dc
commit 2a45521ed7
3 changed files with 24 additions and 0 deletions

View File

@@ -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>()