fix: 修改退出账号功能
Tento commit je obsažen v:
rodič
3b6496773d
revize
42de3bd79c
@ -31,9 +31,6 @@ public class LoginController {
|
||||
@Autowired
|
||||
private LoginService loginService;
|
||||
|
||||
@Autowired
|
||||
private LogoutSuccessHandlerImpl logoutSuccessHandler;
|
||||
|
||||
@PostMapping("/login")
|
||||
@ApiOperation(value = "登录")
|
||||
public ResponseResult login(HttpServletRequest request, @RequestBody LoginParam loginParam) {
|
||||
|
@ -14,5 +14,4 @@ public interface LoginService {
|
||||
|
||||
ResponseResult login(HttpServletRequest request, LoginParam loginParam);
|
||||
|
||||
ResponseResult logout();
|
||||
}
|
||||
|
@ -50,14 +50,4 @@ public class LoginServiceImpl implements LoginService {
|
||||
return new ResponseResult(200,"登录成功",map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseResult logout() {
|
||||
//获取SecurityContextHolder中的用户id
|
||||
UsernamePasswordAuthenticationToken authentication = (UsernamePasswordAuthenticationToken) SecurityContextHolder.getContext().getAuthentication();
|
||||
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
||||
String userid = loginUser.getSysUserEntity().getId().toString();
|
||||
//删除redis中的值
|
||||
redisTemplate.delete("login:"+userid);
|
||||
return new ResponseResult(200,"注销成功");
|
||||
}
|
||||
}
|
||||
|
Načítá se…
Odkázat v novém úkolu
Zablokovat Uživatele