升级到.net core 3.1;整体组件升级到最新版本

This commit is contained in:
2019-12-06 16:26:46 +08:00
parent d40f0b8eaf
commit 206993241a
16 changed files with 179 additions and 61 deletions
+14 -11
View File
@@ -77,7 +77,10 @@ namespace COMCMS.Web
//记录错误
options.Filters.Add<HttpGlobalExceptionFilter>();
})
.AddNewtonsoftJson(options =>options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver());
.AddNewtonsoftJson(options => {
options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
});
//防止汉字被自动编码
services.Configure<WebEncoderOptions>(options =>
@@ -92,16 +95,16 @@ namespace COMCMS.Web
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie();
// 设置表单内容限制
//services.Configure<FormOptions>(options =>
//{
// //formOptions.ValueLengthLimit = int.MaxValue; // 表单内容大小限制,默认4194304,单位byte
// //formOptions.MultipartBodyLengthLimit = int.MaxValue; // 如果是multipart,默认134217728
// options.ValueCountLimit = int.MaxValue;
// options.ValueLengthLimit = int.MaxValue;
// options.KeyLengthLimit = int.MaxValue;
// options.MultipartBodyLengthLimit = int.MaxValue;
// options.MultipartBoundaryLengthLimit = int.MaxValue;
//});
services.Configure<FormOptions>(options =>
{
//formOptions.ValueLengthLimit = int.MaxValue; // 表单内容大小限制,默认4194304,单位byte
//formOptions.MultipartBodyLengthLimit = int.MaxValue; // 如果是multipart,默认134217728
options.ValueCountLimit = int.MaxValue;
options.ValueLengthLimit = int.MaxValue;
options.KeyLengthLimit = int.MaxValue;
options.MultipartBodyLengthLimit = int.MaxValue;
options.MultipartBoundaryLengthLimit = int.MaxValue;
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.