Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -38,6 +38,8 @@ public class ServiceVerifyConfigOption
|
||||
|
||||
public string ThirdPdfUrl { get; set; }
|
||||
|
||||
public int UserMFAVerifyDays { get; set; } = 1;
|
||||
|
||||
}
|
||||
|
||||
public class SystemEmailSendConfig
|
||||
@@ -53,7 +55,7 @@ public class SystemEmailSendConfig
|
||||
|
||||
public string SiteUrl { get; set; } = string.Empty;
|
||||
|
||||
public string SystemShortName { get; set; } = string.Empty;
|
||||
public string SystemShortName { get; set; } = string.Empty;
|
||||
|
||||
public string OrganizationName { get; set; } = string.Empty;
|
||||
public string OrganizationNameCN { get; set; } = string.Empty;
|
||||
@@ -72,12 +74,12 @@ public class SystemEmailSendConfig
|
||||
|
||||
public string EmailRegexStr { get; set; }
|
||||
|
||||
public List<string> ErrorNoticeEmailList { get; set; } =new List<string>();
|
||||
public List<string> ErrorNoticeEmailList { get; set; } = new List<string>();
|
||||
}
|
||||
|
||||
public class SystemEmailSendConfigView
|
||||
{
|
||||
public string SystemShortName { get; set; } = string.Empty;
|
||||
public string SystemShortName { get; set; } = string.Empty;
|
||||
public string CompanyName { get; set; } = string.Empty;
|
||||
|
||||
public string CompanyNameCN { get; set; } = string.Empty;
|
||||
|
||||
@@ -61,6 +61,9 @@ public static class CacheKeys
|
||||
/// <returns></returns>
|
||||
public static string StartRestTime(Guid userId) => $"{userId}StartRestTime";
|
||||
|
||||
|
||||
public static string UserMFAVerifyPass(Guid userId) => $"UserMFAVerifyPass:{userId}";
|
||||
|
||||
}
|
||||
|
||||
public static class CacheHelper
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
ISearcher _searcher, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, IUserService
|
||||
{
|
||||
|
||||
private ServiceVerifyConfigOption _serviceVerifyConfigConfig = _verifyConfig.CurrentValue;
|
||||
private SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
|
||||
|
||||
private async Task VerifyUserNameAsync(Guid? identityUserId, string userName)
|
||||
@@ -857,6 +857,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
}
|
||||
|
||||
await _fusionCache.SetAsync(CacheKeys.UserMFAVerifyPass(identityUserId), true, TimeSpan.FromDays(_serviceVerifyConfigConfig.UserMFAVerifyDays));
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
@@ -1120,9 +1122,16 @@ namespace IRaCIS.Core.Application.Service
|
||||
if (_verifyConfig.CurrentValue.OpenLoginMFA)
|
||||
{
|
||||
|
||||
//MFA 发送邮件
|
||||
if ((await _fusionCache.GetOrDefaultAsync(CacheKeys.UserMFAVerifyPass(identityUserId), false)) == true)
|
||||
{
|
||||
userLoginReturnModel.IsMFA = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//MFA 发送邮件
|
||||
|
||||
userLoginReturnModel.IsMFA = true;
|
||||
userLoginReturnModel.IsMFA = true;
|
||||
}
|
||||
|
||||
var email = userLoginReturnModel.BasicInfo.EMail;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user