|
|
|
@ -65,11 +65,11 @@ public class SysLoginService
|
|
|
|
|
public String login(String username, String password, String code, String uuid)
|
|
|
|
|
{
|
|
|
|
|
// 验证码校验
|
|
|
|
|
validateCaptcha(username, code, uuid);
|
|
|
|
|
// validateCaptcha(username, code, uuid);
|
|
|
|
|
// 登录前置校验
|
|
|
|
|
loginPreCheck(username, password);
|
|
|
|
|
// 用户验证
|
|
|
|
|
Authentication authentication = null;
|
|
|
|
|
Authentication authentication;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password);
|
|
|
|
@ -96,6 +96,7 @@ public class SysLoginService
|
|
|
|
|
}
|
|
|
|
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
|
|
|
|
|
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
|
|
|
|
loginUser.getUser().setPassword(null);
|
|
|
|
|
recordLoginInfo(loginUser.getUserId());
|
|
|
|
|
// 生成token
|
|
|
|
|
return tokenService.createToken(loginUser);
|
|
|
|
|