修改发送邮件提示

IRC_NewDev
hang 2024-07-10 09:08:41 +08:00
parent d1e4863e01
commit 003b227f7d
2 changed files with 36 additions and 23 deletions

View File

@ -63,17 +63,30 @@
"OpenLoginMFA": false "OpenLoginMFA": false
}, },
//"SystemEmailSendConfig": {
// "Port": 465,
// "Host": "smtp.qiye.aliyun.com",
// "FromEmail": "test@extimaging.com",
// "FromName": "Test_IRC",
// "AuthorizationCode": "SHzyyl2021",
// "SiteUrl": "http://irc.test.extimaging.com/login",
// "CompanyName": "Extensive Imaging",
// "CompanyNameCN": "上海展影医疗科技有限公司",
// "CompanyShortName": "Extensive Imaging",
// "CompanyShortNameCN": "展影医疗"
//}
"SystemEmailSendConfig": { "SystemEmailSendConfig": {
"Port": 465, "Port": 587,
"Host": "smtp.qiye.aliyun.com", "Host": "smtp-mail.outlook.com",
"FromEmail": "test@extimaging.com", "FromEmail": "donotreply@elevateimaging.ai",
"FromName": "Test_IRC", "FromName": "LiLi",
"AuthorizationCode": "SHzyyl2021", "AuthorizationCode": "Q#669869497420ul",
"SiteUrl": "http://irc.test.extimaging.com/login", "CompanyName": "Elevate Imaging Inc.",
"CompanyName": "Extensive Imaging",
"CompanyNameCN": "上海展影医疗科技有限公司", "CompanyNameCN": "上海展影医疗科技有限公司",
"CompanyShortName": "Extensive Imaging", "CompanyShortName": "Elevate Imaging",
"CompanyShortNameCN": "展影医疗" "CompanyShortNameCN": "展影医疗",
"SiteUrl": "https://lili.test.elevateimaging.ai/login"
} }
} }

View File

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