From 9df57ed6a52eb712b09d944b5a7ba5ec4c620f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Fri, 22 Dec 2023 21:15:02 +0800 Subject: [PATCH] =?UTF-8?q?GetImageFiles=E4=BB=A5List=E5=85=A5?= =?UTF-8?q?=E5=8F=82=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=A3=80=E6=9F=A5=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E6=97=B6=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 24Hour/Controllers/Common/CommonController.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/24Hour/Controllers/Common/CommonController.cs b/24Hour/Controllers/Common/CommonController.cs index 5d67717..2e48831 100644 --- a/24Hour/Controllers/Common/CommonController.cs +++ b/24Hour/Controllers/Common/CommonController.cs @@ -2843,13 +2843,9 @@ namespace _24Hour.Controllers.Common return result; } - public class GetBaseStringDto - { - public List Files { get; set; } - } [HttpPost] [Route("GetImageFiles")] - public async Task GetImageFiles(GetBaseStringDto file) + public async Task GetImageFiles(List file) { //根据输入url获取base64值 var getstr = (string s) => @@ -2870,9 +2866,9 @@ namespace _24Hour.Controllers.Common { var urlpath = s.Replace("/", @"\"); var path = Path.Combine(Environment.CurrentDirectory, "wwwroot" + urlpath); - return System.IO.File.Exists(s); + return System.IO.File.Exists(path); }; - var data = file.Files.Select(x => new + var data = file.Select(x => new { Item=x, IsExist = getexist(x),