Abp Vnext 的 Vue3 实现版本
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

84 lines
2.9 KiB

namespace Lion.AbpPro;
[DependsOn(
typeof(AbpProHttpApiModule),
typeof(AbpProAspNetCoreModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
typeof(AbpProEntityFrameworkCoreModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpAccountWebModule),
typeof(AbpProApplicationModule),
// typeof(AbpProCapModule),
// typeof(AbpProCapEntityFrameworkCoreModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpDistributedLockingModule),
typeof(AbpBlobStoringFileSystemModule),
typeof(AbpProStarterModule),
typeof(AbpSwashbuckleModule)
//typeof(AbpBackgroundJobsHangfireModule)
)]
public partial class AbpProHttpApiHostModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
// 动态配置
// PreConfigure<AbpAspNetCoreMvcOptions>(options =>
// {
// options.ConventionalControllers.Create(typeof(AbpProApplicationModule).Assembly);
// });
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services
.AddAbpProAuditLog()
.AddAbpProAuthentication()
.AddAbpProMultiTenancy()
.AddAbpProRedis()
.AddAbpProRedisDistributedLocking()
.AddAbpProMiniProfiler()
.AddAbpProCors()
.AddAbpProAntiForgery()
.AddAbpProIdentity()
.AddAbpProBlobStorage()
.AddAbpProSignalR()
.AddAbpProHealthChecks()
.AddAbpProTenantResolvers()
.AddAbpProLocalization()
.AddAbpProExceptions()
.AddAbpProConsul()
.AddAbpProSwagger("AbpPro");
context.Services.AddAlwaysAllowAuthorization();
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
app.UseAbpProRequestLocalization();
app.UseCorrelationId();
app.MapAbpStaticAssets();
app.UseAbpProMiniProfiler();
app.UseRouting();
app.UseAbpProCors();
app.UseAuthentication();
app.UseAbpProMultiTenancy();
app.UseAuthorization();
app.UseAbpProSwaggerUI("/swagger/AbpPro/swagger.json","AbpPro");
app.UseAbpProAuditing();
app.UseAbpSerilogEnrichers();
app.UseUnitOfWork();
app.UseConfiguredEndpoints(endpoints =>
{
endpoints.MapHealthChecks("/health");
// endpoints.MapHangfireDashboard("/hangfire", new DashboardOptions()
// {
// Authorization = new[] { new CustomHangfireAuthorizeFilter() },
// IgnoreAntiforgeryToken = true
// });
});
app.UseAbpProConsul();
}
}