|
|
@@ -78,7 +78,7 @@ public class TokenController {
|
|
|
throw new ServiceException("系统异常");
|
|
|
}
|
|
|
}else {
|
|
|
- throw new CaptchaException("验证码不正确");
|
|
|
+ throw new ServiceException("验证码不正确",503);
|
|
|
}
|
|
|
}else {
|
|
|
userInfo = sysLoginService.login(form.getUsername(), UserConstants.USER_LOGIN_PC, form.getPassword());
|
|
|
@@ -188,12 +188,14 @@ public class TokenController {
|
|
|
if (StringUtils.isEmpty(count)){
|
|
|
redisTemplate.opsForValue().set(countKey,"1",60,TimeUnit.MINUTES);
|
|
|
}else {
|
|
|
- int i=Integer.parseInt(count);
|
|
|
- if (i>=5){
|
|
|
- throw new ServiceException("验证码发送超过限制,请一小时后再试",530);
|
|
|
+ if (count!=null){
|
|
|
+ int i=Integer.parseInt(count);
|
|
|
+ if (i>=5){
|
|
|
+ throw new ServiceException("验证码发送超过限制,请一小时后再试",530);
|
|
|
+ }
|
|
|
+ i++;
|
|
|
+ redisTemplate.opsForValue().set(countKey,i+"",60,TimeUnit.MINUTES);
|
|
|
}
|
|
|
- i++;
|
|
|
- redisTemplate.opsForValue().set(countKey,i+"",60,TimeUnit.MINUTES);
|
|
|
}
|
|
|
return R.ok(code);
|
|
|
// return stockService.sendSydSms(code, 2, null, form.getUsername());
|