From e29e54a416d1c2f3bd0a64367f026bee387c1d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Wed, 22 Dec 2021 16:53:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=BA=8F=E5=88=97=E5=8C=96=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Controllers/BaseController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/BaseController.cs b/ZR.Admin.WebApi/Controllers/BaseController.cs index 5565b2d..d5f3a02 100644 --- a/ZR.Admin.WebApi/Controllers/BaseController.cs +++ b/ZR.Admin.WebApi/Controllers/BaseController.cs @@ -18,7 +18,7 @@ namespace ZR.Admin.WebApi.Controllers public static string TIME_FORMAT_FULL = "yyyy-MM-dd HH:mm:ss"; public static string TIME_FORMAT_FULL_2 = "MM-dd HH:mm:ss"; - protected IActionResult SUCCESS(object data, string timeFormatStr = "yyyy-MM-dd HH:mm:ss") + protected IActionResult SUCCESS(object data, string timeFormatStr = "MM-dd HH:mm") { string jsonStr = GetJsonStr(GetApiResult(data != null ? ResultCode.SUCCESS : ResultCode.FAIL, data), timeFormatStr); return Content(jsonStr, "application/json"); @@ -36,13 +36,13 @@ namespace ZR.Admin.WebApi.Controllers /// /// /// - protected IActionResult ToResponse(ApiResult apiResult, string timeFormatStr = "yyyy-MM-dd HH:mm:ss") + protected IActionResult ToResponse(ApiResult apiResult, string timeFormatStr = "MM-dd HH:mm") { string jsonStr = GetJsonStr(apiResult, timeFormatStr); return Content(jsonStr, "application/json"); } - protected IActionResult ToResponse(long rows, string timeFormatStr = "yyyy-MM-dd HH:mm:ss") + protected IActionResult ToResponse(long rows, string timeFormatStr = "MM-dd HH:mm") { string jsonStr = GetJsonStr(ToJson(rows), timeFormatStr); @@ -112,7 +112,7 @@ namespace ZR.Admin.WebApi.Controllers protected string ExportExcel(List list, string sheetName, string fileName) { IWebHostEnvironment webHostEnvironment = (IWebHostEnvironment)App.ServiceProvider.GetService(typeof(IWebHostEnvironment)); - string sFileName = $"{fileName}{DateTime.Now:yyyyMMddHHmmss}.xlsx"; + string sFileName = $"{fileName}{DateTime.Now:MMddHHmmss}.xlsx"; string newFileName = Path.Combine(webHostEnvironment.WebRootPath, "export", sFileName); //调试模式需要加上 ExcelPackage.LicenseContext = LicenseContext.NonCommercial;