|
@@ -10,6 +10,7 @@ import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
+import org.springframework.data.redis.core.StringRedisTemplate;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -33,6 +34,9 @@ public class PermissionUpdateProducer {
|
|
@Resource(name = "redisTemplate")
|
|
@Resource(name = "redisTemplate")
|
|
private RedisTemplate<String, Object> redisTemplate;
|
|
private RedisTemplate<String, Object> redisTemplate;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private StringRedisTemplate stringRedisTemplate;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private DcucAuthZerotrustConfig zerotrustConfig;
|
|
private DcucAuthZerotrustConfig zerotrustConfig;
|
|
|
|
|
|
@@ -120,11 +124,12 @@ public class PermissionUpdateProducer {
|
|
// 加上认证下发的用户令牌前缀
|
|
// 加上认证下发的用户令牌前缀
|
|
.map(item -> ZerotrustAuthRedisConstant.REDIS_IDCARD_TOKEN_NAMESPACE + item)
|
|
.map(item -> ZerotrustAuthRedisConstant.REDIS_IDCARD_TOKEN_NAMESPACE + item)
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
- List<Object> tokenList = redisTemplate.opsForValue().multiGet(userTokenKeys);
|
|
|
|
|
|
+ // 因为存入的时候使用的是StringRedisTemplate取值也要用对应的对象,key序列化问题导致
|
|
|
|
+ List<String> tokenList = stringRedisTemplate.opsForValue().multiGet(userTokenKeys);
|
|
List<String> userTokens = Optional.ofNullable(tokenList)
|
|
List<String> userTokens = Optional.ofNullable(tokenList)
|
|
.orElse(Collections.emptyList())
|
|
.orElse(Collections.emptyList())
|
|
.stream()
|
|
.stream()
|
|
- .map(e -> Optional.ofNullable(e).map(Object::toString).orElse(""))
|
|
|
|
|
|
+ .map(e -> Optional.ofNullable(e).orElse(""))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
// 标注规范用户权限变更通知
|
|
// 标注规范用户权限变更通知
|