fix:尝试调整hangfire中间件顺序使其可以访问
This commit is contained in:
parent
ff30123859
commit
a599c51fcc
@ -72,22 +72,25 @@ public class SjzyTrackApiModule : AbpModule
|
|||||||
{
|
{
|
||||||
var app = context.GetApplicationBuilder();
|
var app = context.GetApplicationBuilder();
|
||||||
var env = context.GetEnvironment();
|
var env = context.GetEnvironment();
|
||||||
|
var configuration = context.GetConfiguration();
|
||||||
|
|
||||||
if (env.IsDevelopment())
|
if (env.IsDevelopment())
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
|
app.UseHangfireDashboard("/hangfire", new DashboardOptions
|
||||||
|
{
|
||||||
|
AppPath = configuration["Swagger:JsonUrlPrefix"]! + "/",
|
||||||
|
PrefixPath = System.Diagnostics.Debugger.IsAttached
|
||||||
|
? ""
|
||||||
|
: configuration["Swagger:JsonUrlPrefix"]!,
|
||||||
|
DashboardTitle = "轨迹预警任务",
|
||||||
|
Authorization = new[] { new AnonymousHangfireAuthorizationFilter() }
|
||||||
|
});
|
||||||
|
|
||||||
app.UseRequestCulture();
|
app.UseRequestCulture();
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
app.UseCorsPolicy();
|
app.UseCorsPolicy();
|
||||||
app.UseConfiguredEndpoints();
|
app.UseConfiguredEndpoints();
|
||||||
app.UseAbpSwaggerUI(env);
|
app.UseAbpSwaggerUI(env);
|
||||||
app.UseHangfireDashboard("/hangfire", new DashboardOptions
|
|
||||||
{
|
|
||||||
AppPath = "/trackApi",
|
|
||||||
PrefixPath = env.IsDevelopment() ? "" : "/trackApi",
|
|
||||||
DashboardTitle = "轨迹预警任务",
|
|
||||||
Authorization = new[] { new AnonymousHangfireAuthorizationFilter() }
|
|
||||||
});
|
|
||||||
app.UseAbpSerilogEnrichers();
|
app.UseAbpSerilogEnrichers();
|
||||||
app.UsePrometheus();
|
app.UsePrometheus();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user