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(); // 后缀