소스 검색

用户密码相关

sqg 3 년 전
부모
커밋
9bc5539f63

+ 1 - 1
tianhu-system/src/main/java/com/tianhu/system/controller/SysProfileController.java

@@ -94,7 +94,7 @@ public class SysProfileController extends BaseController
         {
             return AjaxResult.error("修改密码失败,旧密码错误");
         }
-        String chackPassword = "^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$).{6,20}$";
+        String chackPassword = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$";
         Pattern regePassword = Pattern.compile(chackPassword);
         Matcher matcherPassword = regePassword.matcher(newPassword);
         boolean isMatPassword = matcherPassword.matches();

+ 1 - 1
tianhu-system/src/main/java/com/tianhu/system/controller/SysUserController.java

@@ -804,7 +804,7 @@ public class SysUserController extends BaseController
     @PutMapping("/resetPwd")
     public AjaxResult resetPwd(@RequestBody SysUser user)
     {
-        String checkPassword = "^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$).{6,20}$";
+        String checkPassword = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$";
         Pattern regePassword = Pattern.compile(checkPassword);
         Matcher matcherPassword = regePassword.matcher(user.getPassword());
         boolean isMatPassword = matcherPassword.matches();