From 872ecf9143d35fe04b0c445a2a180d102fdac8b2 Mon Sep 17 00:00:00 2001 From: smallchill Date: Tue, 12 Feb 2019 17:11:45 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../springblade/core/secure/utils/SecureUtil.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/blade-core-secure/src/main/java/org/springblade/core/secure/utils/SecureUtil.java b/blade-core-secure/src/main/java/org/springblade/core/secure/utils/SecureUtil.java index 575b2c1..dfbc381 100644 --- a/blade-core-secure/src/main/java/org/springblade/core/secure/utils/SecureUtil.java +++ b/blade-core-secure/src/main/java/org/springblade/core/secure/utils/SecureUtil.java @@ -99,7 +99,8 @@ public class SecureUtil { * @return userId */ public static Integer getUserId() { - return (null == getUser()) ? -1 : getUser().getUserId(); + BladeUser user = getUser(); + return (null == user) ? -1 : user.getUserId(); } /** @@ -109,7 +110,8 @@ public class SecureUtil { * @return userId */ public static Integer getUserId(HttpServletRequest request) { - return (null == getUser(request)) ? -1 : getUser().getUserId(); + BladeUser user = getUser(request); + return (null == user) ? -1 : user.getUserId(); } /** @@ -118,7 +120,8 @@ public class SecureUtil { * @return userAccount */ public static String getUserAccount() { - return (null == getUser()) ? StringPool.EMPTY : getUser().getAccount(); + BladeUser user = getUser(); + return (null == user) ? StringPool.EMPTY : user.getAccount(); } /** @@ -128,7 +131,8 @@ public class SecureUtil { * @return userAccount */ public static String getUserAccount(HttpServletRequest request) { - return (null == getUser(request)) ? StringPool.EMPTY : getUser().getAccount(); + BladeUser user = getUser(request); + return (null == user) ? StringPool.EMPTY : user.getAccount(); } /**