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.
 
 
 
 
 
 

55 lines
1.9 KiB

using Lion.AbpPro.AspNetCore;
namespace MyCompanyName.MyProjectName.MyModuleName;
[DependsOn(
typeof(AbpProAspNetCoreModule),
typeof(MyModuleNameApplicationModule),
typeof(MyModuleNameEntityFrameworkCoreModule),
typeof(MyModuleNameHttpApiModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
typeof(AbpAutofacModule),
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpEntityFrameworkCorePostgreSqlModule),
typeof(AbpAspNetCoreSerilogModule)
)]
public class MyModuleNameHttpApiHostModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpProSwagger("MyProjectName")
.AddAbpProRedis()
.AddAbpProCors()
.AddAbpProLocalization()
.AddAbpProExceptions()
.AddAbpProHealthChecks()
.AddAbpProTenantResolvers()
.AddAbpProMultiTenancy()
.AddAbpProAntiForgery()
.AddAbpProVirtualFileSystem()
.AddAbpProDbContext()
.AddAlwaysAllowAuthorization();
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
app.UseAbpProRequestLocalization();
app.UseCorrelationId();
app.MapAbpStaticAssets();
app.UseRouting();
app.UseAbpProCors();
app.UseAuthentication();
app.UseAbpProMultiTenancy();
app.UseAuthorization();
app.UseAbpProSwaggerUI("/swagger/MyProjectName/swagger.json", "MyProjectName");
app.UseAbpSerilogEnrichers();
app.UseUnitOfWork();
app.UseConfiguredEndpoints(endpoints => { endpoints.MapHealthChecks("/health"); });
}
}