| | |
| | | /// 手机号 |
| | | /// </summary> |
| | | [ValidationItemMetadata(@"^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$", "手机号格式不正确")] |
| | | PhoneNumber, |
| | | ValidPhoneNumber, |
| | | /// <summary> |
| | | /// 身份证号 |
| | | /// </summary> |
| | | [ValidationItemMetadata(@"^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])\d{3}(\d|X|x)$", "身份证号格式不正确")] |
| | | Identity, |
| | | ValiIdentity, |
| | | } |
| | | } |
| | |
| | | 验证类型 |
| | | </summary> |
| | | </member> |
| | | <member name="F:FlexJobApi.Core.EnumValidationTypes.PhoneNumber"> |
| | | <member name="F:FlexJobApi.Core.EnumValidationTypes.ValidPhoneNumber"> |
| | | <summary> |
| | | 手机号 |
| | | </summary> |
| | | </member> |
| | | <member name="F:FlexJobApi.Core.EnumValidationTypes.Identity"> |
| | | <member name="F:FlexJobApi.Core.EnumValidationTypes.ValiIdentity"> |
| | | <summary> |
| | | 身份证号 |
| | | </summary> |
| | |
| | | /// 身份证号 |
| | | /// </summary> |
| | | [Required] |
| | | [DataValidation(EnumValidationTypes.Identity)] |
| | | [DataValidation(EnumValidationTypes.ValiIdentity)] |
| | | public string Identity { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <remarks>联系电话</remarks> |
| | | [Required] |
| | | [DataValidation(EnumValidationTypes.PhoneNumber)] |
| | | [DataValidation(EnumValidationTypes.ValidPhoneNumber)] |
| | | public string ContactPhoneNumber { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | var options = App.GetOptions<AliyunOptions>().OSS; |
| | | var client = new OssClient(options.Endpoint, options.AccessKeyId, options.AccessSecret); |
| | | var req = new GeneratePresignedUriRequest(options.BucketName, url, SignHttpMethod.Get) |
| | | var req = new GeneratePresignedUriRequest(options.BucketName, url.TrimStart('/'), SignHttpMethod.Get) |
| | | { |
| | | Expiration = DateTime.Now.AddHours(1), |
| | | Process = process |
| | |
| | | |
| | | public static bool CheckIsIdentityNumber18(this string identity) |
| | | { |
| | | return identity.IsNotNull() && identity.TryValidate(EnumValidationTypes.Identity).IsValid && identity.Length == 18; |
| | | return identity.IsNotNull() && identity.TryValidate(EnumValidationTypes.ValiIdentity).IsValid && identity.Length == 18; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | errors.Add("请填写手机号"); |
| | | } |
| | | else if (!model.ContactPhoneNumber.TryValidate(EnumValidationTypes.PhoneNumber).IsValid) |
| | | else if (!model.ContactPhoneNumber.TryValidate(EnumValidationTypes.ValidPhoneNumber).IsValid) |
| | | { |
| | | errors.Add("手机号格式不正确"); |
| | | } |
| | |
| | | { |
| | | errors.Add("请填写身份证号"); |
| | | } |
| | | else if (!model.Identity.TryValidate(EnumValidationTypes.Identity).IsValid) |
| | | else if (!model.Identity.TryValidate(EnumValidationTypes.ValiIdentity).IsValid) |
| | | { |
| | | errors.Add("身份证号格式不正确"); |
| | | } |