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 failing

This commit is contained in:
he
2025-10-20 15:34:14 +08:00
4 changed files with 31 additions and 5 deletions
@@ -826,9 +826,10 @@ namespace IRaCIS.Core.Application.Service
/// 验证MFA 邮件
/// </summary>
/// <param name="Code"></param>
/// <param name="isRemember"></param>
/// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception>
public async Task<IResponseOutput> VerifyMFACodeAsync(string Code)
public async Task<IResponseOutput> VerifyMFACodeAsync(string Code, bool isRemember)
{
var identityUserId = _userInfo.IdentityUserId;
@@ -858,7 +859,12 @@ namespace IRaCIS.Core.Application.Service
}
}
await _fusionCache.SetAsync(CacheKeys.UserMFAVerifyPass(identityUserId), true, TimeSpan.FromDays(_serviceVerifyConfigConfig.UserMFAVerifyDays));
if (isRemember)
{
await _fusionCache.SetAsync(CacheKeys.UserMFAVerifyPass(identityUserId), _userInfo.BrowserFingerprint, TimeSpan.FromDays(_serviceVerifyConfigConfig.UserMFAVerifyDays));
}
return ResponseOutput.Ok();
}
@@ -1045,7 +1051,7 @@ namespace IRaCIS.Core.Application.Service
var lastLoginIPRegion = await _userLogRepository.Where(t => t.ActionUserName == actionUserName && userOptTypes.Contains(t.OptType))
.OrderByDescending(t => t.CreateTime).Select(t => t.IPRegion).FirstOrDefaultAsync();
if (lastLoginIPRegion!=null&&lastLoginIPRegion != string.Empty)
if (lastLoginIPRegion != null && lastLoginIPRegion != string.Empty)
{
// 与上一次区域不一致
//if (SplitAndConcatenate(existUserLoginInfo.LastLoginIP) != SplitAndConcatenate(iPRegion))
@@ -1169,7 +1175,7 @@ namespace IRaCIS.Core.Application.Service
if (_verifyConfig.CurrentValue.OpenLoginMFA)
{
if ((await _fusionCache.GetOrDefaultAsync(CacheKeys.UserMFAVerifyPass(identityUserId), false)) == true)
if ((await _fusionCache.GetOrDefaultAsync(CacheKeys.UserMFAVerifyPass(identityUserId), "")) == _userInfo.BrowserFingerprint)
{
userLoginReturnModel.IsMFA = false;
}