山东雷驰
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.

27 lines
776 B

3 months ago
using Hangfire;
using Hangfire.Dashboard;
using Microsoft.AspNetCore.Builder;
namespace Kean.Infrastructure.Hangfire
{
/// <summary>
/// ApplicationBuilder 扩展方法
/// </summary>
public static class ApplicationBuilderExtensions
{
/// <summary>
/// 注册 Hangfire 中间件
/// </summary>
/// <param name="app">应用程序管道</param>
/// <returns>应用程序管道</returns>
public static IApplicationBuilder UseHangfire(this IApplicationBuilder app) =>
app.UseHangfireDashboard(options: new()
{
Authorization = new IDashboardAuthorizationFilter[]
{
new AuthorizationFilter()
}
});
}
}