diff --git a/IRaCIS.Core.API/Progranm.cs b/IRaCIS.Core.API/Progranm.cs index 5e67215f6..87fab940c 100644 --- a/IRaCIS.Core.API/Progranm.cs +++ b/IRaCIS.Core.API/Progranm.cs @@ -160,7 +160,7 @@ builder.Services.AddSignalR(); builder.Services.AddSingleton(); -builder.Services.AddMemoryCache(); +//builder.Services.AddMemoryCache(); diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index b5b0a3f03..9fc51f6b4 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -12,6 +12,7 @@ using Microsoft.Identity.Client; using static IRaCIS.Core.Domain.Share.StaticData; using IRaCIS.Core.Application.ViewModel; using Medallion.Threading; +using EasyCaching.Core; namespace IRaCIS.Application.Services { @@ -25,7 +26,7 @@ namespace IRaCIS.Application.Services private readonly IRepository _userLogRepository; private readonly IDistributedLockProvider _distributedLockProvider; - private readonly IMemoryCache _cache; + private readonly IEasyCachingProvider _cache; private readonly IOptionsMonitor _verifyConfig; @@ -34,7 +35,7 @@ namespace IRaCIS.Application.Services IMailVerificationService mailVerificationService, IRepository verificationCodeRepository, - IMemoryCache cache, + IEasyCachingProvider cache, IRepository userTrialRepository, IOptionsMonitor verifyConfig, IRepository userLogRepository @@ -629,7 +630,7 @@ namespace IRaCIS.Application.Services string cacheKey = $"{cachePrefix}{userName}"; // 从缓存中获取登录失败次数 - int? failCount = _cache.Get(cacheKey); + int? failCount = _cache.Get(cacheKey).Value; if (failCount == null) { diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index c78247062..184132d88 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -89,7 +89,6 @@ namespace IRaCIS.Application.Services IRepository userRepository, IEasyCachingProvider provider, IRepository readingCustomTagRepository, - IMemoryCache cache, IRepository readingCriterionDictionaryRepository, IRepository readingTrialCriterionDictionaryRepository, IRepository tumorAssessmentRepository,