From 89ee082b6480e7bdc9a640f339d706ee4d6fd917 Mon Sep 17 00:00:00 2001 From: niudehua <657563945@qq.com> Date: Tue, 9 Mar 2021 20:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=8C=BF=E5=90=8D?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BC=9A=E8=A2=AB=E9=89=B4=E5=AE=9A=E4=B8=BA?= =?UTF-8?q?anonymousUser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/security/core/util/SecurityFrameworkUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/cn/iocoder/dashboard/framework/security/core/util/SecurityFrameworkUtils.java b/src/main/java/cn/iocoder/dashboard/framework/security/core/util/SecurityFrameworkUtils.java index b6c509b930..da0032ef12 100644 --- a/src/main/java/cn/iocoder/dashboard/framework/security/core/util/SecurityFrameworkUtils.java +++ b/src/main/java/cn/iocoder/dashboard/framework/security/core/util/SecurityFrameworkUtils.java @@ -56,7 +56,7 @@ public class SecurityFrameworkUtils { if (authentication == null) { return null; } - return (LoginUser) authentication.getPrincipal(); + return authentication.getPrincipal() instanceof LoginUser ? (LoginUser) authentication.getPrincipal() : null; } /**