From 76649f264b106dca455a70bec954aa5202dd0198 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 24 Dec 2024 17:39:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=BD=AE=E5=AF=86=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserService.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 2799f9559..aee79516e 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -325,7 +325,7 @@ namespace IRaCIS.Core.Application.Service } ////查找改邮箱或者手机的用户 - var exist = await _identityUserRepository.AnyAsync(t => t.EMail == email); + var exist = await _identityUserRepository.AnyAsync(t => t.EMail == email && t.Status == UserStateEnum.Enable); if (!exist) { @@ -353,7 +353,7 @@ namespace IRaCIS.Core.Application.Service /// [AllowAnonymous] [HttpGet("{email}/{verifyCode}")] - public async Task> VerifyAnonymousVerifyCode(string email, string verifyCode) + public async Task VerifyAnonymousVerifyCode(string email, string verifyCode) { var verificationRecord = await _verificationCodeRepository .Where(t => t.UserId == Guid.Empty && t.Code == verifyCode && t.CodeType == VerifyType.Email && t.EmailOrPhone == email).OrderByDescending(t => t.CreateTime).FirstOrDefaultAsync(); @@ -382,11 +382,9 @@ namespace IRaCIS.Core.Application.Service } } - var list = await _identityUserRepository.Where(t => t.EMail == email && t.Status == UserStateEnum.Enable).Select(t => new UserAccountDto() { Id= t.Id, UserName = t.UserName, UserRealName = t.FullName }).ToListAsync(); + var userInfo = await _identityUserRepository.Where(t => t.EMail == email && t.Status == UserStateEnum.Enable).Select(t => new UserAccountDto() { Id = t.Id, UserName = t.UserName, UserRealName = t.FullName }).FirstOrDefaultAsync(); - - - return list; + return userInfo; }