|
|
|
@ -140,7 +140,7 @@ namespace Infrastructure.Extensions
|
|
|
|
|
json.pattern = new
|
|
|
|
|
{
|
|
|
|
|
regex = regularExpressionAttribute.Pattern,
|
|
|
|
|
message = regularExpressionAttribute.GetErrorMessage(localizer, metadata.DisplayName,regularExpressionAttribute.Pattern)
|
|
|
|
|
message = regularExpressionAttribute.GetErrorMessage(localizer, metadata.DisplayName, regularExpressionAttribute.Pattern)
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
else if (attribute is DataTypeAttribute dataTypeAttribute)
|
|
|
|
@ -149,7 +149,8 @@ namespace Infrastructure.Extensions
|
|
|
|
|
{
|
|
|
|
|
json.format = "email";
|
|
|
|
|
json.ui = "string";
|
|
|
|
|
json.email =new {
|
|
|
|
|
json.email = new
|
|
|
|
|
{
|
|
|
|
|
message = "email格式错误"
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
@ -198,7 +199,7 @@ namespace Infrastructure.Extensions
|
|
|
|
|
json.minLength = new
|
|
|
|
|
{
|
|
|
|
|
min = minLengthAttribute.Length,
|
|
|
|
|
message = minLengthAttribute.GetErrorMessage(localizer, metadata.DisplayName,minLengthAttribute.Length.ToString())
|
|
|
|
|
message = minLengthAttribute.GetErrorMessage(localizer, metadata.DisplayName, minLengthAttribute.Length.ToString())
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
else if (attribute is MaxLengthAttribute maxLengthAttribute)
|
|
|
|
@ -206,7 +207,7 @@ namespace Infrastructure.Extensions
|
|
|
|
|
json.maxLength = new
|
|
|
|
|
{
|
|
|
|
|
max = maxLengthAttribute.Length,
|
|
|
|
|
message = maxLengthAttribute.GetErrorMessage(localizer, metadata.DisplayName,maxLengthAttribute.ToString())
|
|
|
|
|
message = maxLengthAttribute.GetErrorMessage(localizer, metadata.DisplayName, maxLengthAttribute.Length.ToString())
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
else if (attribute is StringLengthAttribute stringLengthAttribute)
|
|
|
|
@ -229,7 +230,7 @@ namespace Infrastructure.Extensions
|
|
|
|
|
message = rangeAttribute.GetErrorMessage(localizer, metadata.DisplayName,
|
|
|
|
|
rangeAttribute.Minimum.ToString(),
|
|
|
|
|
rangeAttribute.Maximum.ToString())
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
else if (attribute is CompareAttribute compareAttribute)
|
|
|
|
|
{//compare 自定义
|
|
|
|
|