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