wxd 1 year ago
parent
commit
d4ccc24f71
  1. 15
      src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs

15
src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs

@ -121,8 +121,6 @@ public class PeisHttpApiHostModule : AbpModule
builder.AddEncryptionCertificate(new X509Certificate2(File.ReadAllBytes(context.Services.GetHostingEnvironment().WebRootPath + "\\encryption-certificate.pfx"), "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.MachineKeySet));
builder.AddSigningCertificate(new X509Certificate2(File.ReadAllBytes(context.Services.GetHostingEnvironment().WebRootPath + "\\signing-certificate.pfx"), "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.MachineKeySet));
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
@ -130,6 +128,7 @@ public class PeisHttpApiHostModule : AbpModule
var configuration = context.Services.GetConfiguration();
var hostingEnvironment = context.Services.GetHostingEnvironment();
ConfigureAuthentication(context);
ConfigureBundles();
ConfigureUrls(configuration);
@ -498,6 +497,8 @@ public class PeisHttpApiHostModule : AbpModule
{
config.UsePostgreSqlStorage(configuration.GetConnectionString("Default"));
});
}
public override async void OnApplicationInitialization(ApplicationInitializationContext context)
{
@ -522,8 +523,8 @@ public class PeisHttpApiHostModule : AbpModule
//配置是否启用任务面板
var IsEnabledDashboard = Convert.ToBoolean(configuration["Hangfire:IsEnabledDashboard"]);
if (IsEnabledDashboard)
var IsEnabledHangfire = Convert.ToBoolean(configuration["Hangfire:IsEnabled"]);
if (IsEnabledHangfire && IsEnabledDashboard)
{
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
@ -632,13 +633,13 @@ public class PeisHttpApiHostModule : AbpModule
app.UseAbpSerilogEnrichers();
app.UseConfiguredEndpoints();
var IsEnabledHangfire = configuration["Hangfire:IsEnabled"];
if (!string.IsNullOrWhiteSpace(IsEnabledHangfire) && Convert.ToBoolean(IsEnabledHangfire) == true)
if (IsEnabledHangfire)
{
//任务计划
await StartScheduler(context);
}
}

Loading…
Cancel
Save