修改验证重复提交
continuous-integration/drone/push Build is passing Details

Test_IRC_Net8
he 2025-10-17 09:40:36 +08:00
parent d96e746db7
commit 2107a42e37
1 changed files with 7 additions and 3 deletions

View File

@ -72,7 +72,7 @@ namespace IRaCIS.Core.Application.BusinessFilter.LegacyController
} }
catch (Exception) catch (Exception)
{ {
throw;
} }
} }
@ -90,7 +90,11 @@ namespace IRaCIS.Core.Application.BusinessFilter.LegacyController
var requestPath = accessor?.HttpContext?.Request?.Path.ToString() ?? string.Empty; var requestPath = accessor?.HttpContext?.Request?.Path.ToString() ?? string.Empty;
// 验证请求频繁情况 // 验证请求频繁情况
if (_userInfo.UserRoleId != default(Guid)&& if (
!requestPath
.Split("/", StringSplitOptions.RemoveEmptyEntries)
.Any(segment => segment.StartsWith("get", StringComparison.OrdinalIgnoreCase)) &&
_userInfo.UserRoleId != default(Guid)&&
RequestDuplicationOptionsMonitor.CurrentValue.IsEnabled && RequestDuplicationOptionsMonitor.CurrentValue.IsEnabled &&
!RequestDuplicationOptionsMonitor.CurrentValue.ExcludePaths.Contains(requestPath)) !RequestDuplicationOptionsMonitor.CurrentValue.ExcludePaths.Contains(requestPath))
{ {
@ -110,7 +114,7 @@ namespace IRaCIS.Core.Application.BusinessFilter.LegacyController
x.RequestKey== requestInfo.RequestKey); x.RequestKey== requestInfo.RequestKey);
if (requestsTimes) if (requestsTimes)
{ {
throw new BusinessValidationFailedException(_localizer["RequestDuplicationFilter_RequestDuplication"], ApiResponseCodeEnum.NeedTips); throw new BusinessValidationFailedException(_localizer["RequestDuplicationFilter_RequestDuplication"], ApiResponseCodeEnum.BusinessValidationFailed);
} }
IRCSystemInfo.RequestRecordList.Add(requestInfo); IRCSystemInfo.RequestRecordList.Add(requestInfo);
} }