|
|
@ -86,8 +86,6 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory<CpA |
|
|
|
logger.info("params token:" + token); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(token)) { |
|
|
|
//return chain.filter(exchange);
|
|
|
|
//throw new RenException(com.epmet.common.token.enums.ErrorCode.ERR10005.getCode(), com.epmet.common.token.enums.ErrorCode.ERR10005.getMsg());
|
|
|
|
return response(exchange,new Result<>().error(ErrorCode.ERR10005.getCode(),ErrorCode.ERR10005.getMsg())); |
|
|
|
} |
|
|
|
try { |
|
|
@ -117,7 +115,7 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory<CpA |
|
|
|
String app = (String) claims.get("app"); |
|
|
|
String client = (String) claims.get("client"); |
|
|
|
String userId = (String) claims.get("userId"); |
|
|
|
//查询Redis,如果没数据,则保持用户信息到Redis
|
|
|
|
//查询Redis
|
|
|
|
TokenDto tokenDto = cpUserDetailRedis.get(app, client, userId); |
|
|
|
if (null == tokenDto) { |
|
|
|
//说明登录状态时效(超时)
|
|
|
@ -133,9 +131,7 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory<CpA |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//过期时间,不延期
|
|
|
|
//long expire = (claims.getExpiration().getTime() - System.currentTimeMillis()) / 1000;
|
|
|
|
//cpUserDetailRedis.set(tokenDto, expire);
|
|
|
|
|
|
|
|
return tokenDto; |
|
|
|
} |
|
|
|
|
|
|
|