清理缓存
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
5f6b174dd9
commit
1e0af11110
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Net.Http;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using AutoMapper;
|
||||
using DocumentFormat.OpenXml.Drawing;
|
||||
using EasyCaching.Core;
|
||||
using ExcelDataReader;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
|
|
|
@ -65,10 +65,6 @@
|
|||
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
|
||||
<PackageReference Include="ConfigMapFileProvider" Version="2.0.1" />
|
||||
<PackageReference Include="EasyCaching.Interceptor.Castle" Version="1.9.2" />
|
||||
<PackageReference Include="EasyCaching.Serialization.MessagePack" Version="1.9.2">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.14" />
|
||||
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
|
||||
<PackageReference Include="Hangfire.InMemory" Version="0.10.3" />
|
||||
|
|
|
@ -162,7 +162,7 @@ builder.Services.AddFusionCache();
|
|||
#endregion
|
||||
|
||||
// EasyCaching 缓存
|
||||
builder.Services.AddEasyCachingSetup(_configuration);
|
||||
//builder.Services.AddEasyCachingSetup(_configuration);
|
||||
|
||||
// hangfire 定时任务框架 有界面,更友好~
|
||||
builder.Services.AddhangfireSetup(_configuration);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using Autofac;
|
||||
using Autofac.Extras.DynamicProxy;
|
||||
using IRaCIS.Core.Application;
|
||||
using IRaCIS.Core.Application.BackGroundJob;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
|
@ -50,7 +49,7 @@ namespace IRaCIS.Core.API
|
|||
|
||||
Assembly application = Assembly.LoadFrom(AppDomain.CurrentDomain.BaseDirectory + "IRaCIS.Core.Application.dll");
|
||||
containerBuilder.RegisterAssemblyTypes(application).Where(t => t.FullName.Contains("Service"))
|
||||
.PropertiesAutowired().AsImplementedInterfaces().EnableClassInterceptors();
|
||||
.PropertiesAutowired().AsImplementedInterfaces();
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using EasyCaching.Core;
|
||||
using EasyCaching.Core.Configurations;
|
||||
using EasyCaching.Interceptor.Castle;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
|
@ -10,18 +7,18 @@ namespace IRaCIS.Core.API
|
|||
{
|
||||
public static void AddEasyCachingSetup(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddEasyCaching(options =>
|
||||
{
|
||||
options.UseInMemory();
|
||||
//services.AddEasyCaching(options =>
|
||||
//{
|
||||
// options.UseInMemory();
|
||||
|
||||
//options.UseRedis(configuration, EasyCachingConstValue.DefaultRedisName).WithMessagePack(EasyCachingConstValue.DefaultRedisName);
|
||||
// //options.UseRedis(configuration, EasyCachingConstValue.DefaultRedisName).WithMessagePack(EasyCachingConstValue.DefaultRedisName);
|
||||
|
||||
|
||||
});
|
||||
//});
|
||||
|
||||
//services.ConfigureCastleInterceptor(options => options.CacheProviderName = EasyCachingConstValue.DefaultRedisName);
|
||||
////services.ConfigureCastleInterceptor(options => options.CacheProviderName = EasyCachingConstValue.DefaultRedisName);
|
||||
|
||||
services.ConfigureCastleInterceptor(options => options.CacheProviderName = EasyCachingConstValue.DefaultInMemoryName);
|
||||
//services.ConfigureCastleInterceptor(options => options.CacheProviderName = EasyCachingConstValue.DefaultInMemoryName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using EasyCaching.Core;
|
||||
using Hangfire;
|
||||
using Hangfire;
|
||||
using Hangfire.Storage;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
|
|
|
@ -63,8 +63,6 @@
|
|||
<PackageReference Include="FreeSpire.Doc" Version="12.2.0" />
|
||||
<PackageReference Include="Hangfire.Core" Version="1.8.14" />
|
||||
<PackageReference Include="Castle.Core.AsyncInterceptor" Version="2.1.0" />
|
||||
<PackageReference Include="EasyCaching.Redis" Version="1.9.2" />
|
||||
<PackageReference Include="EasyCaching.InMemory" Version="1.9.2" />
|
||||
<PackageReference Include="ExcelDataReader" Version="3.7.0" />
|
||||
<PackageReference Include="ExcelDataReader.DataSet" Version="3.7.0" />
|
||||
<PackageReference Include="DistributedLock.Redis" Version="1.0.3" />
|
||||
|
|
|
@ -8,7 +8,6 @@ using IRaCIS.Core.Domain.Models;
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using AutoMapper;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using EasyCaching.Core.Interceptor;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ using IRaCIS.Core.Application.Interfaces;
|
|||
using IRaCIS.Core.Application.ViewModel;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using ZiggyCreatures.Caching.Fusion;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Application.Contracts.Dicom;
|
||||
using IRaCIS.Core.Application.Contracts.Dicom;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System.Text;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using EasyCaching.Core;
|
||||
using FellowOakDicom;
|
||||
using FellowOakDicom;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
|
|
|
@ -3,7 +3,6 @@ using IRaCIS.Core.Domain.Share;
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IRaCIS.Core.Application.Services;
|
||||
using EasyCaching.Core;
|
||||
using System.Linq.Expressions;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Panda.DynamicWebApi.Attributes;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
|
@ -12,13 +11,13 @@ using Microsoft.Identity.Client;
|
|||
using static IRaCIS.Core.Domain.Share.StaticData;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using Medallion.Threading;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IP2Region.Net.Abstractions;
|
||||
using ZiggyCreatures.Caching.Fusion;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
@ -31,7 +30,6 @@ namespace IRaCIS.Application.Services
|
|||
IRepository<UserLog> _userLogRepository,
|
||||
IRepository<UserPassWordLog> _userPassWordLogRepository,
|
||||
IDistributedLockProvider _distributedLockProvider,
|
||||
IEasyCachingProvider _cache,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig,
|
||||
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig,
|
||||
|
@ -102,7 +100,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
throw new BusinessValidationFailedException(_localizer["User_PassWordRepeat"]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (oldPwd != null)
|
||||
|
@ -573,7 +571,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
if (user.IsZhiZhun)
|
||||
{
|
||||
user.OrganizationName = _userInfo.IsEn_Us? _systemEmailConfig.OrganizationName: _systemEmailConfig.OrganizationNameCN ;
|
||||
user.OrganizationName = _userInfo.IsEn_Us ? _systemEmailConfig.OrganizationName : _systemEmailConfig.OrganizationNameCN;
|
||||
}
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId = model.Id, OptType = UserOptType.UpdateUser }, true);
|
||||
|
@ -715,7 +713,7 @@ namespace IRaCIS.Application.Services
|
|||
string cacheKey = $"{cachePrefix}{userName}";
|
||||
|
||||
// 从缓存中获取登录失败次数
|
||||
int? failCount = _cache.Get<int?>(cacheKey).Value;
|
||||
int? failCount = await _fusionCache.GetOrDefaultAsync<int?>(cacheKey);
|
||||
|
||||
if (failCount == null)
|
||||
{
|
||||
|
@ -723,7 +721,7 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
|
||||
//每次登录 都重置缓存时间
|
||||
_cache.Set(cacheKey, failCount, TimeSpan.FromMinutes(lockoutMinutes));
|
||||
await _fusionCache.SetAsync<int?>(cacheKey, failCount, TimeSpan.FromMinutes(lockoutMinutes));
|
||||
|
||||
|
||||
if (failCount >= maxFailures)
|
||||
|
@ -744,7 +742,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
//错误次数累加
|
||||
failCount++;
|
||||
_cache.Set(cacheKey, failCount, TimeSpan.FromMinutes(lockoutMinutes));
|
||||
await _fusionCache.SetAsync(cacheKey, failCount, TimeSpan.FromMinutes(lockoutMinutes));
|
||||
|
||||
var errorPwdUserId = await _userRepository.Where(u => u.UserName == userName).Select(t => t.Id).FirstOrDefaultAsync();
|
||||
|
||||
|
@ -763,7 +761,7 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
|
||||
//超过90天没修改密码
|
||||
if (_verifyConfig.CurrentValue.IsNeedChangePassWord&& loginUser.LastChangePassWordTime != null && DateTime.Now.AddDays(-_verifyConfig.CurrentValue.ChangePassWordDays) > loginUser.LastChangePassWordTime.Value)
|
||||
if (_verifyConfig.CurrentValue.IsNeedChangePassWord && loginUser.LastChangePassWordTime != null && DateTime.Now.AddDays(-_verifyConfig.CurrentValue.ChangePassWordDays) > loginUser.LastChangePassWordTime.Value)
|
||||
{
|
||||
loginUser.LoginState = 1;
|
||||
}
|
||||
|
@ -771,7 +769,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
|
||||
//登录成功 清除缓存
|
||||
_cache.Set(cacheKey, 0, TimeSpan.FromMinutes(lockoutMinutes));
|
||||
await _fusionCache.SetAsync(cacheKey, 0, TimeSpan.FromMinutes(lockoutMinutes));
|
||||
var ipinfo = _searcher.Search(_userInfo.IP);
|
||||
|
||||
var iPRegion = string.Join('|', ipinfo.Split('|').TakeLast(3));
|
||||
|
@ -800,7 +798,7 @@ namespace IRaCIS.Application.Services
|
|||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == loginUser.Id, x => new User()
|
||||
{
|
||||
LastLoginIP = iPRegion,
|
||||
|
@ -815,7 +813,7 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<PageOutput<UserLogView>> GetUserLogList(UserLogQuery inQuery)
|
||||
{
|
||||
DateTime? trialCreateTime = inQuery.TrialId != null ? _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.CreateTime).FirstOrDefault() : null;
|
||||
DateTime? trialCreateTime = inQuery.TrialId != null ? _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.CreateTime).FirstOrDefault() : null;
|
||||
|
||||
var userLogQueryable =
|
||||
_userLogRepository
|
||||
|
|
|
@ -15,7 +15,6 @@ using Newtonsoft.Json.Linq;
|
|||
using Microsoft.Extensions.Caching.Memory;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using DocumentFormat.OpenXml.Drawing;
|
||||
using EasyCaching.Core;
|
||||
using DocumentFormat.OpenXml.Drawing.Charts;
|
||||
using IRaCIS.Core.Application.Service.ReadingCalculate.Interface;
|
||||
using AutoMapper.QueryableExtensions;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using EasyCaching.Core;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
|
|
|
@ -4,7 +4,6 @@ using Microsoft.AspNetCore.Mvc;
|
|||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Panda.DynamicWebApi.Attributes;
|
||||
|
|
|
@ -22,7 +22,6 @@ using Subject = IRaCIS.Core.Domain.Models.Subject;
|
|||
using IRaCIS.Core.Application.ViewModel;
|
||||
using Medallion.Threading;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using EasyCaching.Core;
|
||||
using Pipelines.Sockets.Unofficial.Arenas;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using MailKit.Search;
|
||||
|
@ -39,7 +38,6 @@ using System.IO.Compression;
|
|||
using static IRaCIS.Core.Domain.Share.StaticData;
|
||||
using FellowOakDicom;
|
||||
using DocumentFormat.OpenXml.Office2010.Drawing;
|
||||
using EasyCaching.Core.DistributedLock;
|
||||
using IDistributedLockProvider = Medallion.Threading.IDistributedLockProvider;
|
||||
using DocumentFormat.OpenXml.InkML;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using AutoMapper;
|
||||
using EasyCaching.Core;
|
||||
using EntityFrameworkCore.Triggered;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using AutoMapper;
|
||||
using EasyCaching.Core;
|
||||
using EntityFrameworkCore.Triggered;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using AutoMapper;
|
||||
using EasyCaching.Core;
|
||||
using EntityFrameworkCore.Triggered;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using AutoMapper;
|
||||
using EasyCaching.Core;
|
||||
using EntityFrameworkCore.Triggered;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
|
|
Loading…
Reference in New Issue