From 104f223410c0c2e0c66f94e923efe23ac5e9d70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Mon, 26 Apr 2021 15:03:05 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=BF=94=E5=9B=9E=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Api/Ewide.Web.Core/Startup.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Api/Ewide.Web.Core/Startup.cs b/Api/Ewide.Web.Core/Startup.cs index 2edfd35..a43b19d 100644 --- a/Api/Ewide.Web.Core/Startup.cs +++ b/Api/Ewide.Web.Core/Startup.cs @@ -26,7 +26,9 @@ namespace Ewide.Web.Core .AddMvcFilter() .AddInjectWithUnifyResult() // 在管道中增加NewtonsoftJson,防止参数类型严格验证 - .AddNewtonsoftJson() + .AddNewtonsoftJson(options => { + options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; + }) .AddJsonOptions(options => { //options.JsonSerializerOptions.DefaultBufferSize = 10_0000;//返回较大数据数据序列化时会截断,原因:默认缓冲区大小(以字节为单位)为16384。