修改发送邮件提示
This commit is contained in:
@@ -305,15 +305,15 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
await _mailVerificationService.AdminResetPwdSendEmailAsync(userId, pwd);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//---请检查邮箱地址或者联系维护人员, 邮件发送失败, 未能创建账户成功
|
||||
throw new BusinessValidationFailedException(_localizer["User_CreateFailed"]);
|
||||
}
|
||||
//try
|
||||
//{
|
||||
await _mailVerificationService.AdminResetPwdSendEmailAsync(userId, pwd);
|
||||
//}
|
||||
//catch (Exception)
|
||||
//{
|
||||
// //---请检查邮箱地址或者联系维护人员, 邮件发送失败, 未能创建账户成功
|
||||
// throw new BusinessValidationFailedException(_localizer["User_CreateFailed"]);
|
||||
//}
|
||||
|
||||
|
||||
await _userRepository.UpdatePartialNowNoQueryAsync(userId, u => new User()
|
||||
@@ -644,7 +644,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
public async Task<UserBasicInfo> GetUserBasicInfo(Guid userId, string pwd)
|
||||
{
|
||||
var info = await _userRepository.Where(u => u.Id == userId && u.Password==pwd).ProjectTo<UserBasicInfo>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||
var info = await _userRepository.Where(u => u.Id == userId && u.Password == pwd).ProjectTo<UserBasicInfo>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||
|
||||
return info;
|
||||
}
|
||||
@@ -656,13 +656,13 @@ namespace IRaCIS.Application.Services
|
||||
/// <param name="mfaType"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
public async Task<IResponseOutput> SendMFAEmail(Guid userId, int mfaType )
|
||||
public async Task<IResponseOutput> SendMFAEmail(Guid userId, int mfaType)
|
||||
{
|
||||
var userInfo = await _userRepository.Where(u => u.Id == userId).Select(t => new { t.FullName, t.EMail }).FirstOrDefaultAsync();
|
||||
|
||||
int verificationCode = new Random().Next(100000, 1000000);
|
||||
|
||||
await _mailVerificationService.SenMFAVerifyEmail(userId, userInfo.FullName, userInfo.EMail, verificationCode, (UserMFAType)mfaType );
|
||||
await _mailVerificationService.SenMFAVerifyEmail(userId, userInfo.FullName, userInfo.EMail, verificationCode, (UserMFAType)mfaType);
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
@@ -696,7 +696,7 @@ namespace IRaCIS.Application.Services
|
||||
//---验证码已经过期。
|
||||
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_ExpiredVerificationCode"]);
|
||||
|
||||
|
||||
|
||||
}
|
||||
else //验证码正确 并且 没有超时
|
||||
{
|
||||
@@ -813,7 +813,7 @@ namespace IRaCIS.Application.Services
|
||||
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == loginUser.Id, x => new User()
|
||||
{
|
||||
LastLoginIP = _userInfo.IP,
|
||||
LastLoginTime= DateTime.Now
|
||||
LastLoginTime = DateTime.Now
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user