fix auth
This commit is contained in:
@@ -17,11 +17,10 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.6" />
|
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.7" />
|
||||||
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
|
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
|
||||||
<PackageReference Include="Hangfire.MySqlStorage" Version="2.0.2" />
|
<PackageReference Include="Hangfire.MySqlStorage" Version="2.0.3" />
|
||||||
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.7" />
|
<PackageReference Include="Kurisu.AspNetCore" Version="0.4.7" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.4" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Hangfire;
|
using Hangfire;
|
||||||
|
using Hangfire.Dashboard.BasicAuthorization;
|
||||||
using Hangfire.MySql;
|
using Hangfire.MySql;
|
||||||
using Kurisu.AspNetCore.Startup;
|
using Kurisu.AspNetCore.Startup;
|
||||||
|
|
||||||
@@ -28,8 +29,25 @@ namespace Dlhis.ScheduledTask
|
|||||||
|
|
||||||
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
{
|
{
|
||||||
app.UseHangfireDashboard(); //使用hangfire面板
|
app.UseHangfireDashboard("/hangfire", new DashboardOptions
|
||||||
//app.UseHangfireServer(); //启动hangfire服务
|
{
|
||||||
|
AppPath = null,
|
||||||
|
DashboardTitle = "hangfire",
|
||||||
|
Authorization = new[]
|
||||||
|
{
|
||||||
|
new BasicAuthAuthorizationFilter(new BasicAuthAuthorizationFilterOptions
|
||||||
|
{
|
||||||
|
Users = new []
|
||||||
|
{
|
||||||
|
new BasicAuthAuthorizationUser
|
||||||
|
{
|
||||||
|
Login ="admin",
|
||||||
|
PasswordClear = "zxc111"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
BackgroundJob.Enqueue(() => Console.WriteLine("This is a background job."));
|
BackgroundJob.Enqueue(() => Console.WriteLine("This is a background job."));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user