Quellcode durchsuchen

系统登入禁用图形验证码 captchaCode

reghao vor 3 Monaten
Ursprung
Commit
0ebd049563

+ 2 - 2
web/src/main/java/cn/reghao/bnt/web/admin/model/dto/AccountLoginDto.java

@@ -22,8 +22,8 @@ public class AccountLoginDto implements Serializable {
     private String principal;
     @NotBlank
     private String credential;
-    @Length(min = 5, max = 5, message = "图形验证码应是 5 个字符")
-    private String captchaCode;
+//    @Length(min = 5, max = 5, message = "图形验证码应是 5 个字符")
+//    private String captchaCode;
     private Boolean rememberMe;
 
     public AccountLoginDto() {

+ 3 - 3
web/src/main/java/cn/reghao/bnt/web/admin/service/impl/AccountLoginServiceImpl.java

@@ -49,17 +49,17 @@ public class AccountLoginServiceImpl implements AccountLoginService {
     public AccountAuthToken getPreAuthentication(AccountLoginDto accountLoginDto) {
         String principal = accountLoginDto.getPrincipal();
         String credential = accountLoginDto.getCredential();
-        String captchaCode = accountLoginDto.getCaptchaCode();
+        //String captchaCode = accountLoginDto.getCaptchaCode();
         Boolean rememberMe = accountLoginDto.getRememberMe();
 
-        String savedCaptchaCode = codeService.getCaptcha();
+        /*String savedCaptchaCode = codeService.getCaptcha();
         if (savedCaptchaCode == null) {
             String errMsg = "当前会话已过期, 请刷新页面后重新登入. 或者检查浏览器是否禁用了 cookie";
             throw new PreAuthenticatedCredentialsNotFoundException(errMsg);
         } else if (!savedCaptchaCode.equalsIgnoreCase(captchaCode)) {
             String errMsg = "图形验证码不正确...";
             throw new PreAuthenticatedCredentialsNotFoundException(errMsg);
-        }
+        }*/
 
         String decryptCredential;
         try {