供应计划,仓库映射接口开发
This commit is contained in:
@@ -114,6 +114,8 @@ public class SecurityConfig
|
||||
requests.antMatchers("/login",
|
||||
"/register",
|
||||
"/captchaImage",
|
||||
"/user/**",
|
||||
"/query/jh/**",
|
||||
"/AutoInventory/**",
|
||||
"/ws/**",
|
||||
"/information/device/**",
|
||||
|
||||
@@ -178,4 +178,28 @@ public class SysLoginService
|
||||
sysUser.setLoginDate(DateUtils.getNowDate());
|
||||
userService.updateUserProfile(sysUser);
|
||||
}
|
||||
|
||||
public LoginUser loginWithoutCaptcha(String username, String password) {
|
||||
loginPreCheck(username, password);
|
||||
|
||||
Authentication authentication;
|
||||
|
||||
try {
|
||||
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(username, password);
|
||||
|
||||
AuthenticationContextHolder.setContext(token);
|
||||
|
||||
authentication = authenticationManager.authenticate(token);
|
||||
}catch (Exception e){
|
||||
throw new ServiceException("登录失败");
|
||||
}finally {
|
||||
AuthenticationContextHolder.clearContext();
|
||||
}
|
||||
|
||||
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
||||
|
||||
recordLoginInfo(loginUser.getUserId());
|
||||
|
||||
return loginUser;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user