|
@@ -2,6 +2,7 @@ package org.gateway.filter;
|
|
|
|
|
|
import com.alibaba.cloud.commons.lang.StringUtils;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
import org.apache.http.HttpHeaders;
|
|
|
import org.slf4j.Logger;
|
|
@@ -41,6 +42,7 @@ public class AuthAndLogFilter implements GlobalFilter, Ordered
|
|
|
return chain.filter(exchange.mutate().build());
|
|
|
}
|
|
|
String token = exchange.getRequest().getHeaders().getFirst("Authorization");
|
|
|
+ System.out.println("Authorization is : "+ token);
|
|
|
ServerHttpResponse resp = exchange.getResponse();
|
|
|
if (StringUtils.isBlank(token))
|
|
|
{
|
|
@@ -48,9 +50,8 @@ public class AuthAndLogFilter implements GlobalFilter, Ordered
|
|
|
return denyAccess(exchange, "token不存在");
|
|
|
|
|
|
}
|
|
|
-// SignedJWT jwtToken = jwtLoginService.jwtTokenValidation(token);
|
|
|
+ // redis 连接
|
|
|
RedisConnection redisConnection = redisConnectionFactory.getConnection();
|
|
|
- redisConnection.setex("12122",300,"1111");
|
|
|
String userInfo = (String)redisConnection.get(token);
|
|
|
redisConnection.close();
|
|
|
System.out.println(userInfo);
|