|
@@ -189,8 +189,7 @@ public class SysLoginService {
|
|
|
if (!smsCode.equalsIgnoreCase(code)) {
|
|
|
throw new CaptchaException(); //抛出验证码错误的异常
|
|
|
}
|
|
|
- //成功 删除内存的验证码
|
|
|
- redisCache.deleteObject(verifyKey);
|
|
|
+
|
|
|
Authentication authentication = null; // 用户验证
|
|
|
try {
|
|
|
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(phone, Constants.CUSTOM_LOGIN_SMS);
|
|
@@ -208,6 +207,8 @@ public class SysLoginService {
|
|
|
}
|
|
|
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
|
|
recordLoginInfo(loginUser.getUserId()); //修改sys_user最近登录IP和登录时间
|
|
|
+ //成功 删除内存的验证码
|
|
|
+ redisCache.deleteObject(verifyKey);
|
|
|
// 生成token
|
|
|
return tokenService.createToken(loginUser);
|
|
|
}
|