Browse Source

fix: 修复hangfire dashboard 405

feat/file
Hanpaopao 1 year ago
parent
commit
35cc40c1f6
  1. 19
      aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs
  2. 12
      templates/pro-nuget/service/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs

19
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();

12
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))

Loading…
Cancel
Save