|
|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using Medallion.Threading;
|
|
|
|
|
using Medallion.Threading.Redis;
|
|
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
|
using Microsoft.AspNetCore.DataProtection;
|
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
|
@ -28,6 +30,7 @@ using Volo.Abp.Autofac;
|
|
|
|
|
using Volo.Abp.AutoMapper;
|
|
|
|
|
using Volo.Abp.Caching;
|
|
|
|
|
using Volo.Abp.Caching.StackExchangeRedis;
|
|
|
|
|
using Volo.Abp.DistributedLocking;
|
|
|
|
|
using Volo.Abp.Http.Client.IdentityModel.Web;
|
|
|
|
|
using Volo.Abp.Http.Client.Web;
|
|
|
|
|
using Volo.Abp.Identity.Web;
|
|
|
|
|
@ -53,6 +56,7 @@ namespace MyCompanyName.MyProjectName.Web;
|
|
|
|
|
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
|
|
|
|
|
typeof(AbpAutofacModule),
|
|
|
|
|
typeof(AbpCachingStackExchangeRedisModule),
|
|
|
|
|
typeof(AbpDistributedLockingModule),
|
|
|
|
|
typeof(AbpSettingManagementWebModule),
|
|
|
|
|
typeof(AbpHttpClientIdentityModelWebModule),
|
|
|
|
|
typeof(AbpIdentityWebModule),
|
|
|
|
|
@ -83,6 +87,7 @@ public class MyProjectNameWebModule : AbpModule
|
|
|
|
|
ConfigureBundles();
|
|
|
|
|
ConfigureCache();
|
|
|
|
|
ConfigureDataProtection(context, configuration, hostingEnvironment);
|
|
|
|
|
ConfigureDistributedLocking(context, configuration);
|
|
|
|
|
ConfigureUrls(configuration);
|
|
|
|
|
ConfigureAuthentication(context, configuration);
|
|
|
|
|
ConfigureAutoMapper();
|
|
|
|
|
@ -227,6 +232,18 @@ public class MyProjectNameWebModule : AbpModule
|
|
|
|
|
dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ConfigureDistributedLocking(
|
|
|
|
|
ServiceConfigurationContext context,
|
|
|
|
|
IConfiguration configuration)
|
|
|
|
|
{
|
|
|
|
|
context.Services.AddSingleton<IDistributedLockProvider>(sp =>
|
|
|
|
|
{
|
|
|
|
|
var connection = ConnectionMultiplexer
|
|
|
|
|
.Connect(configuration["Redis:Configuration"]);
|
|
|
|
|
return new RedisDistributedSynchronizationProvider(connection.GetDatabase());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
|
|
|
|
{
|
|
|
|
|
|