class 添加默认方法,支持老的代码

This commit is contained in:
2024-04-16 06:57:56 +08:00
parent 6ef7aca8ae
commit a1f10b9c09
8 changed files with 36 additions and 11 deletions
+3 -1
View File
@@ -6,7 +6,7 @@ using Microsoft.OpenApi.Models;
using SimApi.Middlewares;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.Extensions.Logging;
using SimApi.Configs;
using SimApi.Configurations;
using SimApi.Logger;
namespace SimApi;
@@ -30,6 +30,7 @@ public static class SimApiExtensions
logger.AddProvider(new SimApiLoggerProvider());
});
}
// 是否使用 AUTH
if (simApiOptions.EnableSimApiAuth)
{
@@ -199,6 +200,7 @@ public static class SimApiExtensions
var logger = builder.ApplicationServices.GetRequiredService<ILogger<SimApiOptions>>();
logger.LogInformation("当前时区: {LocalId}", TimeZoneInfo.Local.Id);
if (options.EnableForwardHeaders)
{
logger.LogInformation("开始配置ForwardedHeaders...");