fix: password strength
This commit is contained in:
parent
76d9ed3f0a
commit
ddb43cdf58
@ -19,6 +19,6 @@ public class UserPasswordDto {
|
||||
private String oldPassword;
|
||||
|
||||
@NotBlank(message = "新密码不可为空!")
|
||||
@Pattern(regexp = StrengthUtils.PATTERN, message = "密码强度不够,至少应该包含数字、大小写字母、符号组合!")
|
||||
@Pattern(regexp = StrengthUtils.PATTERN, message = "密码强度不够,12-18位,至少应该包含数字、大小写字母、符号组合!")
|
||||
private String password;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import java.util.regex.Pattern;
|
||||
*/
|
||||
public abstract class StrengthUtils {
|
||||
|
||||
public static final String PATTERN = "^(?![a-zA-z]+$)(?!\\d+$)(?![,.!?~`_+=@#$%^&*;<>':]+$)(?![a-zA-z\\d]+$)(?![a-zA-z,.!?~`_+=@#$%^&*;<>':]+$)(?![\\d,.!?~`_+=@#$%^&*;<>':]+$)[a-zA-Z\\d,.!?~`_+=@#$%^&*;<>':]{8,16}$";
|
||||
public static final String PATTERN = "^(?![a-zA-z]+$)(?!\\d+$)(?![,.!?~`_+=@#$%^&*;<>':]+$)(?![a-zA-z\\d]+$)(?![a-zA-z,.!?~`_+=@#$%^&*;<>':]+$)(?![\\d,.!?~`_+=@#$%^&*;<>':]+$)[a-zA-Z\\d,.!?~`_+=@#$%^&*;<>':]{12,18}$";
|
||||
|
||||
/**
|
||||
* 此处传入密码明文判定密码可用性
|
||||
|
Loading…
Reference in New Issue
Block a user