diff --git a/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java b/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java index fedadfd8..d0c7c9eb 100644 --- a/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java +++ b/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java @@ -83,8 +83,9 @@ public class TokenController { @DeleteMapping("logout") public R logout() { try { + String username = LoginHelper.getUsername(); StpUtil.logout(); - sysLoginService.logout(LoginHelper.getUsername()); + sysLoginService.logout(username); } catch (NotLoginException e) { } return R.ok();