From 42de3bd79c9b8e1afd95737c7308dc9ea5238568 Mon Sep 17 00:00:00 2001 From: weihongyang <1075331873@qq.com> Date: Thu, 23 Jun 2022 12:09:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E9=80=80=E5=87=BA?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cnbm/admin/controller/LoginController.java | 3 --- .../main/java/com/cnbm/admin/service/LoginService.java | 1 - .../com/cnbm/admin/service/impl/LoginServiceImpl.java | 10 ---------- 3 files changed, 14 deletions(-) diff --git a/ym-admin/src/main/java/com/cnbm/admin/controller/LoginController.java b/ym-admin/src/main/java/com/cnbm/admin/controller/LoginController.java index 64cc902..66bc7a8 100644 --- a/ym-admin/src/main/java/com/cnbm/admin/controller/LoginController.java +++ b/ym-admin/src/main/java/com/cnbm/admin/controller/LoginController.java @@ -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) { diff --git a/ym-admin/src/main/java/com/cnbm/admin/service/LoginService.java b/ym-admin/src/main/java/com/cnbm/admin/service/LoginService.java index c3f3cff..9f93524 100644 --- a/ym-admin/src/main/java/com/cnbm/admin/service/LoginService.java +++ b/ym-admin/src/main/java/com/cnbm/admin/service/LoginService.java @@ -14,5 +14,4 @@ public interface LoginService { ResponseResult login(HttpServletRequest request, LoginParam loginParam); - ResponseResult logout(); } diff --git a/ym-admin/src/main/java/com/cnbm/admin/service/impl/LoginServiceImpl.java b/ym-admin/src/main/java/com/cnbm/admin/service/impl/LoginServiceImpl.java index cee7f12..1c8fdbb 100644 --- a/ym-admin/src/main/java/com/cnbm/admin/service/impl/LoginServiceImpl.java +++ b/ym-admin/src/main/java/com/cnbm/admin/service/impl/LoginServiceImpl.java @@ -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,"注销成功"); - } }