From b1c2f2170c2a042a3573f6cd6af487ad27b00575 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 16 Nov 2023 16:59:48 +0800 Subject: [PATCH] Reorder middlewares. Resolve #18158 --- .../MyProjectNameAuthServerModule.cs | 3 ++- .../MyProjectNameBlazorModule.cs | 4 +++- .../MyProjectNameHttpApiHostModule.cs | 3 ++- .../MyProjectNameHttpApiHostModule.cs | 2 +- .../MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs | 4 +++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs index 4c191579f8..e8c1dd4646 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs @@ -217,9 +217,10 @@ public class MyProjectNameAuthServerModule : AbpModule app.UseMultiTenancy(); } - app.UseDynamicClaims(); app.UseUnitOfWork(); + app.UseDynamicClaims(); app.UseAuthorization(); + app.UseAuditing(); app.UseAbpSerilogEnrichers(); app.UseConfiguredEndpoints(); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs index 8c93eeca33..adaf76a6cf 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs @@ -270,14 +270,16 @@ public class MyProjectNameBlazorModule : AbpModule { app.UseMultiTenancy(); } - app.UseDynamicClaims(); app.UseUnitOfWork(); + app.UseDynamicClaims(); app.UseAuthorization(); + app.UseSwagger(); app.UseAbpSwaggerUI(options => { options.SwaggerEndpoint("/swagger/v1/swagger.json", "MyProjectName API"); }); + app.UseConfiguredEndpoints(); } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index e785db843a..74c74d8a4e 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs @@ -195,6 +195,8 @@ public class MyProjectNameHttpApiHostModule : AbpModule { app.UseMultiTenancy(); } + + app.UseUnitOfWork(); app.UseDynamicClaims(); app.UseAuthorization(); @@ -210,7 +212,6 @@ public class MyProjectNameHttpApiHostModule : AbpModule app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseUnitOfWork(); app.UseConfiguredEndpoints(); } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs index 45d3c605e7..9e2863aca4 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs @@ -203,8 +203,8 @@ public class MyProjectNameHttpApiHostModule : AbpModule { app.UseMultiTenancy(); } - app.UseDynamicClaims(); app.UseUnitOfWork(); + app.UseDynamicClaims(); app.UseAuthorization(); app.UseSwagger(); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs index 1b61db27c0..3d36e378f6 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs @@ -235,14 +235,16 @@ public class MyProjectNameWebModule : AbpModule app.UseMultiTenancy(); } - app.UseDynamicClaims(); app.UseUnitOfWork(); + app.UseDynamicClaims(); app.UseAuthorization(); + app.UseSwagger(); app.UseAbpSwaggerUI(options => { options.SwaggerEndpoint("/swagger/v1/swagger.json", "MyProjectName API"); }); + app.UseAuditing(); app.UseAbpSerilogEnrichers(); app.UseConfiguredEndpoints();