Commit ac0d24e8 authored by 技术部-任文超's avatar 技术部-任文超

调整账密登录时的图形验证码相关文案

parent 52a33e10
...@@ -115,7 +115,7 @@ public class CaptchaFiniteValidateAdvisor { ...@@ -115,7 +115,7 @@ public class CaptchaFiniteValidateAdvisor {
return pjp.proceed(); return pjp.proceed();
} }
} }
return JsonResult.buildSuccessResult("图形验证码不正确", "", 2L); return JsonResult.buildSuccessResult("请输入图形验证码", "", 2L);
} }
return pjp.proceed(); return pjp.proceed();
} }
......
package cn.quantgroup.xyqb.controller; package cn.quantgroup.xyqb.controller;
import cn.quantgroup.xyqb.exception.NullUserException; import cn.quantgroup.xyqb.exception.NullUserException;
import cn.quantgroup.xyqb.exception.PasswordErrorLimitException;
import cn.quantgroup.xyqb.exception.UserNotExistException; import cn.quantgroup.xyqb.exception.UserNotExistException;
import cn.quantgroup.xyqb.exception.VerificationCodeErrorException; import cn.quantgroup.xyqb.exception.VerificationCodeErrorException;
import cn.quantgroup.xyqb.model.JsonResult; import cn.quantgroup.xyqb.model.JsonResult;
...@@ -34,7 +35,18 @@ public class ExceptionHandlingController implements IBaseController { ...@@ -34,7 +35,18 @@ public class ExceptionHandlingController implements IBaseController {
} }
/** /**
* 验证码登陆异常 * 密码错误次数达到上限异常
*
* @param vce
* @return
*/
@ExceptionHandler(PasswordErrorLimitException.class)
public JsonResult passwordErrorLimitException(PasswordErrorLimitException vce) {
return JsonResult.buildErrorStateResult(vce.getMessage(), null, 2L);
}
/**
* 密码错误次数过多异常,提升验证级别
* *
* @param vce * @param vce
* @return * @return
......
...@@ -10,6 +10,7 @@ import cn.quantgroup.xyqb.entity.Merchant; ...@@ -10,6 +10,7 @@ import cn.quantgroup.xyqb.entity.Merchant;
import cn.quantgroup.xyqb.entity.User; import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail; import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.entity.WechatUserInfo; import cn.quantgroup.xyqb.entity.WechatUserInfo;
import cn.quantgroup.xyqb.exception.PasswordErrorLimitException;
import cn.quantgroup.xyqb.exception.UserNotExistException; import cn.quantgroup.xyqb.exception.UserNotExistException;
import cn.quantgroup.xyqb.exception.VerificationCodeErrorException; import cn.quantgroup.xyqb.exception.VerificationCodeErrorException;
import cn.quantgroup.xyqb.model.JsonResult; import cn.quantgroup.xyqb.model.JsonResult;
...@@ -542,7 +543,10 @@ public class UserController implements IBaseController { ...@@ -542,7 +543,10 @@ public class UserController implements IBaseController {
stringRedisTemplate.opsForValue().set(key, String.valueOf(0), Constants.ONE_DAY, TimeUnit.SECONDS); stringRedisTemplate.opsForValue().set(key, String.valueOf(0), Constants.ONE_DAY, TimeUnit.SECONDS);
} }
// 密码错误计数 // 密码错误计数
stringRedisTemplate.opsForValue().increment(key, 1L); Long errorCount = stringRedisTemplate.opsForValue().increment(key, 1L);
if(errorCount > Constants.Image_Need_Count){
throw new PasswordErrorLimitException("请输入图形验证码");
}
return null; return null;
} }
return user; return user;
......
package cn.quantgroup.xyqb.exception; package cn.quantgroup.xyqb.exception;
/** /**
* @author mengfan.feng * 密码错误次数达到上限异常
* @time 2015-09-08 17:49 * @author 任文超
* @time 2017-11-10
*/ */
public class PasswordErrorException extends RuntimeException { public class PasswordErrorLimitException extends RuntimeException {
private static final long serialVersionUID = -1L; private static final long serialVersionUID = -1L;
public PasswordErrorException(String msg, Throwable t) { public PasswordErrorLimitException(String msg, Throwable t) {
super(msg, t); super(msg, t);
} }
public PasswordErrorException(String msg) { public PasswordErrorLimitException(String msg) {
super(msg); super(msg);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment