From 35cc40c1f67c0d78799eb7e4e2a6ed151160b892 Mon Sep 17 00:00:00 2001 From: Hanpaopao <510423039@qq.com> Date: Fri, 14 Feb 2025 12:22:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dhangfire=20dashboard?= =?UTF-8?q?=20405?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbpProHttpApiHostModule.cs | 19 +++++++++++++------ .../MyProjectNameHttpApiHostModule.cs | 12 +++++++++++- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs index 247fffe5..f7d91c61 100644 --- a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs +++ b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs @@ -76,13 +76,20 @@ namespace Lion.AbpPro app.UseAuditing(); app.UseAbpSerilogEnrichers(); app.UseUnitOfWork(); - app.UseConfiguredEndpoints(endpoints => { endpoints.MapHealthChecks("/health"); }); - // app.UseHangfireDashboard("/hangfire", new DashboardOptions() - // { - // Authorization = new[] { new CustomHangfireAuthorizeFilter() }, - // IgnoreAntiforgeryToken = true - // }); + + app.UseConfiguredEndpoints(endpoints => + { + endpoints.MapHealthChecks("/health"); + + // endpoints.MapHangfireDashboard("/hangfire", new DashboardOptions() + // { + // Authorization = new[] { new CustomHangfireAuthorizeFilter() }, + // IgnoreAntiforgeryToken = true + // }); + }); + app.UseConfiguredEndpoints(endpoints => { endpoints.MapHealthChecks("/health"); }); + if (configuration.GetValue("Consul:Enabled", false)) { app.UseConsul(); diff --git a/templates/pro-nuget/service/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/pro-nuget/service/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index 934b3597..ec6f2499 100644 --- a/templates/pro-nuget/service/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/templates/pro-nuget/service/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs @@ -58,7 +58,17 @@ namespace MyCompanyName.MyProjectName app.UseAbpSerilogEnrichers(); app.UseUnitOfWork(); - app.UseConfiguredEndpoints(endpoints => { endpoints.MapHealthChecks("/health"); }); + app.UseConfiguredEndpoints(endpoints => + { + endpoints.MapHealthChecks("/health"); + + // endpoints.MapHangfireDashboard("/hangfire", new DashboardOptions() + // { + // Authorization = new[] { new CustomHangfireAuthorizeFilter() }, + // IgnoreAntiforgeryToken = true + // }); + + }); if (configuration.GetValue("Consul:Enabled", false))