From ae7f54c4d6a75f33e38f484e91d0dcf8aa0b1cec Mon Sep 17 00:00:00 2001 From: zuohuaijun Date: Mon, 15 Jul 2024 14:43:07 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=98=8E=E5=A2=9E=E5=8A=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0=E6=97=B6=E6=A0=BC=E5=BC=8F=E5=92=8C?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Admin.NET/Admin.NET.Core/Service/File/SysFileService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Admin.NET/Admin.NET.Core/Service/File/SysFileService.cs b/Admin.NET/Admin.NET.Core/Service/File/SysFileService.cs index ba8fbcde..fb2cf9d1 100644 --- a/Admin.NET/Admin.NET.Core/Service/File/SysFileService.cs +++ b/Admin.NET/Admin.NET.Core/Service/File/SysFileService.cs @@ -315,11 +315,11 @@ public class SysFileService : IDynamicApiController, ITransient // 验证文件类型 if (!_uploadOptions.ContentType.Contains(file.ContentType)) - throw Oops.Oh(ErrorCodeEnum.D8001); + throw Oops.Oh($"{ErrorCodeEnum.D8001}:{file.ContentType}"); // 验证文件大小 if (sizeKb > _uploadOptions.MaxSize) - throw Oops.Oh(ErrorCodeEnum.D8002); + throw Oops.Oh($"{ErrorCodeEnum.D8002},允许最大:{_uploadOptions.MaxSize}KB"); // 获取文件后缀 var suffix = Path.GetExtension(file.FileName).ToLower(); // 后缀