From 2a9a4c6828cd9a9f1bfcbf27ada73da41558c741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Wed, 29 Nov 2023 16:11:00 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20token=20=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E5=90=8E=20=E7=99=BB=E5=BD=95=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=A8=E6=88=B7null=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/dromara/auth/service/SysLoginService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ruoyi-auth/src/main/java/org/dromara/auth/service/SysLoginService.java b/ruoyi-auth/src/main/java/org/dromara/auth/service/SysLoginService.java index f1f6d224..32be56d0 100644 --- a/ruoyi-auth/src/main/java/org/dromara/auth/service/SysLoginService.java +++ b/ruoyi-auth/src/main/java/org/dromara/auth/service/SysLoginService.java @@ -102,6 +102,9 @@ public class SysLoginService { public void logout() { try { LoginUser loginUser = LoginHelper.getLoginUser(); + if (ObjectUtil.isNull(loginUser)) { + return; + } if (TenantHelper.isEnable() && LoginHelper.isSuperAdmin()) { // 超级管理员 登出清除动态租户 TenantHelper.clearDynamic();