😎调整Oops.Oh文件类型提示信息
This commit is contained in:
parent
7e1fee09c3
commit
e584731e71
@ -530,9 +530,9 @@ public enum ErrorCodeEnum
|
||||
D8000,
|
||||
|
||||
/// <summary>
|
||||
/// 不允许的文件类型
|
||||
/// 不允许的文件类型
|
||||
/// </summary>
|
||||
[ErrorCodeItemMetadata("不允许的文件类型")]
|
||||
[ErrorCodeItemMetadata("不允许的文件类型:{0}")]
|
||||
D8001,
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -258,7 +258,7 @@ public class SysFileService : IDynamicApiController, ITransient
|
||||
}
|
||||
|
||||
// 验证文件类型
|
||||
if (!_uploadOptions.ContentType.Contains(input.File.ContentType)) throw Oops.Oh($"{ErrorCodeEnum.D8001}:{input.File.ContentType}");
|
||||
if (!_uploadOptions.ContentType.Contains(input.File.ContentType)) throw Oops.Oh(ErrorCodeEnum.D8001, input.File.ContentType);
|
||||
|
||||
// 验证文件大小
|
||||
if (sizeKb > _uploadOptions.MaxSize) throw Oops.Oh($"{ErrorCodeEnum.D8002},允许最大:{_uploadOptions.MaxSize}KB");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user