This commit is contained in:
parent
a39856db9c
commit
adfa62854a
@ -3,9 +3,11 @@ using Fake.AspNetCore.Auditing;
|
||||
using Fake.AspNetCore.Authentication;
|
||||
using Fake.AspNetCore.ExceptionHandling;
|
||||
using Fake.AspNetCore;
|
||||
using Fake.AspNetCore.Newtonsoft;
|
||||
using Fake.AspNetCore.Swagger;
|
||||
using Fake.Autofac;
|
||||
using Fake.FeiShu;
|
||||
using Fake.Json;
|
||||
using Fake.Modularity;
|
||||
using Fake.Security.Claims;
|
||||
using Fake.Serilog;
|
||||
@ -65,14 +67,12 @@ public class TrackCenterApiModule : FakeModule
|
||||
}).AddNewtonsoftJson();
|
||||
|
||||
//Json格式化全局处理
|
||||
context.Services.Configure<MvcNewtonsoftJsonOptions>(options =>
|
||||
services.Configure<FakeJsonSerializerOptions>(options =>
|
||||
{
|
||||
options.SerializerSettings.ContractResolver =
|
||||
new Newtonsoft.Json.Serialization.
|
||||
CamelCasePropertyNamesContractResolver(); // 首字母小写(驼峰样式)
|
||||
options.SerializerSettings.Converters.Add(new DateTimeJsonConverter("yyyy-MM-dd HH:mm:ss"));
|
||||
options.SerializerSettings.Converters.Add(new LongJsonConverter());
|
||||
options.InputDateTimeFormats.Add("yyyy-MM-dd HH:mm:ss");
|
||||
options.LongToString = true;
|
||||
});
|
||||
context.Services.AddFakeNewtonsoft();
|
||||
|
||||
services.AddFakeSwaggerGen(addSecurity:true)
|
||||
.AddFakeAspNetCoreAuditing()
|
||||
|
||||
@ -63,7 +63,7 @@ public class TrackCenterApplicationModule : FakeModule
|
||||
options.FallbackWindowLookbackSeconds =
|
||||
configuration.GetValue<int>("CAP:FallbackWindowLookbackSeconds");
|
||||
|
||||
options.UseDashboard(dashboardOptions => { dashboardOptions.PathBase = ""; });
|
||||
options.UseDashboard(dashboardOptions => { dashboardOptions.PathBase = configuration["ASPNETCORE_PATHBASE"]; });
|
||||
options.FailedThresholdCallback = faileCalback =>
|
||||
{
|
||||
try
|
||||
|
||||
Loading…
Reference in New Issue
Block a user