Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

用户注册的bug #252

Open
yours520 opened this issue Sep 29, 2021 · 5 comments
Open

用户注册的bug #252

yours520 opened this issue Sep 29, 2021 · 5 comments

Comments

@yours520
Copy link

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
Copy link
Contributor

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
Copy link
Author

yours520 commented Nov 14, 2021 via email

@towelong
Copy link
Contributor

对啊,这个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
Copy link
Contributor

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

@yours520
Copy link
Author

yours520 commented Nov 14, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants