TaleLin / lin-cms-spring-boot

🔨 基于SpringBoot的CMS/DMS/管理系统开发框架
http://doc.cms.talelin.com/
MIT License
912 stars 255 forks source link

用户注册的bug #252

Open yours520 opened 3 years ago

yours520 commented 3 years ago

phone那里用的@Max注解,导致无法正常注册

`@Data @NoArgsConstructor @EqualField(srcField = "password", dstField = "confirmPassword", message = "{password.equal-field}") public class RegisterDTO {

@NotBlank(message = "{username.not-blank}")
@Length(min = 2, max = 10, message = "{username.length}")
private String username;

private List<Integer> groupIds;

@Email(message = "{email}")
private String email;

@NotBlank(message = "{password.new.not-blank}")
@Pattern(regexp = "^[A-Za-z0-9_*&$#@]{6,22}$", message = "{password.new.pattern}")
private String password;

@NotBlank(message = "{password.confirm.not-blank}")
private String confirmPassword;

@Max(value = 30)
private String phone;

}`

towelong commented 2 years ago

phone那里用的@max注解,导致无法正常注册

`@Data @NoArgsConstructor @EqualField(srcField = "password", dstField = "confirmPassword", message = "{password.equal-field}") public class RegisterDTO {

@NotBlank(message = "{username.not-blank}")
@Length(min = 2, max = 10, message = "{username.length}")
private String username;

private List<Integer> groupIds;

@Email(message = "{email}")
private String email;

@NotBlank(message = "{password.new.not-blank}")
@Pattern(regexp = "^[A-Za-z0-9_*&$#@]{6,22}$", message = "{password.new.pattern}")
private String password;

@NotBlank(message = "{password.confirm.not-blank}")
private String confirmPassword;

@Max(value = 30)
private String phone;

}`

image 麻烦请再学习下这部分的内容(Hibernate Validator)

yours520 commented 2 years ago

对啊,这个max注解不是你们框架加的吗,只能用在数字上,你们用在字符串上了

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: WeLong @.> 发送时间: 2021年11月14日 11:14 收件人: TaleLin/lin-cms-spring-boot @.> 抄送: yours520 @.>, Author @.> 主题: 回复:[TaleLin/lin-cms-spring-boot] 用户注册的bug (#252)

@.***注解,导致无法正常注册

@.** @NoArgsConstructor @EqualField(srcField = "password", dstField = "confirmPassword", message = "{password.equal-field}") public class RegisterDTO { @NotBlank(message = "{username.not-blank}") @Length(min = 2, max = 10, message = "{username.length}") private String username; private List<Integer> groupIds; @Email(message = "{email}") private String email; @NotBlank(message = "{password.new.not-blank}") @Pattern(regexp = "^[A-Za-z0-9_&$#@]{6,22}$", message = "{password.new.pattern}") private String password; @NotBlank(message = "{password.confirm.not-blank}") private String confirmPassword; @Max(value = 30) private String phone;
}`

麻烦请再学习下这部分的内容(Hibernate Validator)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

towelong commented 2 years ago

对啊,这个max注解不是你们框架加的吗,只能用在数字上,你们用在字符串上了 发自我的iPhone ------------------ 原始邮件 ------------------ 发件人: WeLong @.> 发送时间: 2021年11月14日 11:14 收件人: TaleLin/lin-cms-spring-boot @.> 抄送: yours520 @.>, Author @.> 主题: 回复:[TaleLin/lin-cms-spring-boot] 用户注册的bug (#252) @.注解,导致无法正常注册 @. @NoArgsConstructor @EqualField(srcField = "password", dstField = "confirmPassword", message = "{password.equal-field}") public class RegisterDTO { @notblank(message = "{username.not-blank}") @Length(min = 2, max = 10, message = "{username.length}") private String username; private List<Integer> groupIds; @Email(message = "{email}") private String email; @notblank(message = "{password.new.not-blank}") @pattern(regexp = "^[A-Za-z0-9_*&$#@]{6,22}$", message = "{password.new.pattern}") private String password; @notblank(message = "{password.confirm.not-blank}") private String confirmPassword; @max(value = 30) private String phone; }` 麻烦请再学习下这部分的内容(Hibernate Validator) — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

image 没有啊,请问你用的是最新版本吗

towelong commented 2 years ago

image 数据库里面我们也没有这个字段的,你看看git记录,应该是你自己加的吧

yours520 commented 2 years ago

我再核对一下,谢谢了。

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: WeLong @.> 发送时间: 2021年11月14日 12:20 收件人: TaleLin/lin-cms-spring-boot @.> 抄送: yours520 @.>, Author @.> 主题: 回复:[TaleLin/lin-cms-spring-boot] 用户注册的bug (#252)

数据库里面我们也没有这个字段的,你看看git记录,应该是你自己加的吧

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.