|
@@ -1,5 +1,6 @@
|
|
|
package com.zhongzheng.common.utils;
|
|
|
|
|
|
+import cn.hutool.core.lang.Validator;
|
|
|
import com.aliyun.dysmsapi20170525.models.SendSmsRequest;
|
|
|
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
|
|
|
import com.aliyun.teaopenapi.models.Config;
|
|
@@ -11,6 +12,8 @@ import java.nio.charset.StandardCharsets;
|
|
|
import java.security.MessageDigest;
|
|
|
import java.security.NoSuchAlgorithmException;
|
|
|
import java.util.*;
|
|
|
+import java.util.regex.Matcher;
|
|
|
+import java.util.regex.Pattern;
|
|
|
import java.util.zip.ZipEntry;
|
|
|
import java.util.zip.ZipOutputStream;
|
|
|
|
|
@@ -315,4 +318,22 @@ public class ToolsUtils {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ public static boolean verifPwd(String passWord) {
|
|
|
+ if(Validator.isEmpty(passWord)){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(passWord.length()<6||passWord.length()>18){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ /* String regExp = "^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\\W_!@#$%^&*`~()-+=]+$)(?![0-9\\W_!@#$%^&*`~()-+=]+$)(?![a-zA-Z0-9]+$)(?![a-zA-Z\\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9\\W_!@#$%^&*`~()-+=]+$)(?![0-9A-Z\\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\\W_!@#$%^&*`~()-+=]{6,16}$";
|
|
|
+ Pattern p = Pattern.compile(regExp);
|
|
|
+ Matcher m = p.matcher(passWord);
|
|
|
+ if (m.matches()){
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }*/
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
}
|