From abb401ce03cb16ee4cf661b5b5a1da1bc99bb624 Mon Sep 17 00:00:00 2001 From: jiarunguang Date: Fri, 18 Jun 2021 16:45:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=9B=86=E6=88=90Redisson?= =?UTF-8?q?=E6=97=B6ValueWrapper=E5=8F=98=E4=B8=BANullValue=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E8=AE=A4=E8=AF=81=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20fix=20#182?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../authorization/simple/SimpleAuthenticationManager.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleAuthenticationManager.java b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleAuthenticationManager.java index a5f7861eb..29658564a 100644 --- a/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleAuthenticationManager.java +++ b/hsweb-system/hsweb-system-authorization/hsweb-system-authorization-local/src/main/java/org/hswebframework/web/service/authorization/simple/SimpleAuthenticationManager.java @@ -6,7 +6,6 @@ import org.hswebframework.web.authorization.Authentication; import org.hswebframework.web.authorization.AuthenticationInitializeService; import org.hswebframework.web.authorization.AuthenticationManager; import org.hswebframework.web.authorization.AuthenticationRequest; -import org.hswebframework.web.authorization.listener.event.AuthorizationFailedEvent; import org.hswebframework.web.authorization.simple.PlainTextUsernamePasswordAuthenticationRequest; import org.hswebframework.web.commons.entity.DataStatus; import org.hswebframework.web.entity.authorization.UserEntity; @@ -16,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.CachePut; -import org.springframework.cache.annotation.Cacheable; import java.util.function.Supplier; @@ -98,7 +96,7 @@ public class SimpleAuthenticationManager implements AuthenticationManager { if (null != cacheManager) { Cache cache = cacheManager.getCache(USER_AUTH_CACHE_NAME); Cache.ValueWrapper wrapper = cache.get(userId); - if (wrapper == null) { + if (wrapper == null || wrapper.get() == null) { Authentication authentication = supplier.get(); cache.put(userId, authentication); return authentication;