From b85bc1bd2f21d9a6a9513b1c5c0d8ff9fe8d38fd Mon Sep 17 00:00:00 2001 From: Lianxw Date: Tue, 14 Jul 2020 15:47:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=BD=9C=E5=9C=A8=E7=9A=84=E7=A9=BA?= =?UTF-8?q?=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8=20=E8=BF=99=E9=87=8C?= =?UTF-8?q?=E7=9A=84cache=E5=AD=98=E5=9C=A8=E6=BD=9C=E5=9C=A8=E7=9A=84?= =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/security/service/PigUserDetailsServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java index 0e172cc0..7237e8e5 100755 --- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java +++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java @@ -73,7 +73,9 @@ public class PigUserDetailsServiceImpl implements UserDetailsService { R result = remoteUserService.info(username, SecurityConstants.FROM_IN); UserDetails userDetails = getUserDetails(result); - cache.put(username, userDetails); + if (cache != null) { + cache.put(username, userDetails); + } return userDetails; }