From 682ded3eecfdc9d5a62992c13570be47124a432d Mon Sep 17 00:00:00 2001 From: HanPaoPao <510423039@qq.com> Date: Wed, 15 Oct 2025 10:19:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/Login.cshtml.cs | 2 +- .../Program.cs | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Pages/Login.cshtml.cs b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Pages/Login.cshtml.cs index 40c0e50c..f2ef1002 100644 --- a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Pages/Login.cshtml.cs +++ b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Pages/Login.cshtml.cs @@ -57,7 +57,7 @@ namespace Lion.AbpPro.Pages var result = await _accountAppService.LoginAsync(new LoginInput() { Name = userName, Password = password }); - Response.Cookies.Append(AbpProHttpApiHostConst.DefaultCookieName, + Response.Cookies.Append(AbpProAspNetCoreConsts.DefaultCookieName, result.Token, options); } catch (Exception e) diff --git a/templates/pro-nuget/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs b/templates/pro-nuget/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs index a29ba1fe..0e9a4b48 100644 --- a/templates/pro-nuget/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs +++ b/templates/pro-nuget/service/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs @@ -1,7 +1,9 @@ -namespace MyCompanyName.MyProjectName +namespace MyCompanyName.MyProjectName; + +public class Program { - public class Program - { + public static async Task Main(string[] args) + { Log.Logger = new LoggerConfiguration() .WriteTo.Async(c => c.File("Logs/logs.txt")) .WriteTo.Async(c => c.Console()) @@ -9,6 +11,7 @@ namespace MyCompanyName.MyProjectName try { + Log.Information("MyCompanyName.MyProjectName.HttpApi.Host."); var builder = WebApplication.CreateBuilder(args); builder.Host .AddAppSettingsSecretsJson() @@ -19,6 +22,8 @@ namespace MyCompanyName.MyProjectName loggerConfiguration, context.Configuration); }); + // 设置MaxRequestBodySize + //builder.WebHost.ConfigureKestrel(options => options.Limits.MaxRequestBodySize = 52428800); await builder.AddApplicationAsync(); var app = builder.Build(); await app.InitializeApplicationAsync(); @@ -38,6 +43,6 @@ namespace MyCompanyName.MyProjectName finally { await Log.CloseAndFlushAsync(); - } + } } -} +} \ No newline at end of file