fix 取消base64校验
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Dlhis.Basic.Organization.Request;
|
namespace Dlhis.Basic.Organization.Request;
|
||||||
|
|
||||||
public class GainfoUploadFaceRequest : IValidatableObject
|
public class GainfoUploadFaceRequest
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户档案号
|
/// 用户档案号
|
||||||
@@ -15,22 +15,4 @@ public class GainfoUploadFaceRequest : IValidatableObject
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Required(ErrorMessage = "人脸照片不能为空")]
|
[Required(ErrorMessage = "人脸照片不能为空")]
|
||||||
public string Face { get; set; }
|
public string Face { get; set; }
|
||||||
|
|
||||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
||||||
{
|
|
||||||
bool v = true;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Convert.FromBase64String(Face);
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
v = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!v)
|
|
||||||
{
|
|
||||||
yield return new ValidationResult("人脸照片需要为Base64格式", new[] { nameof(Face) });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user