diff --git a/iot-gateway/src/main/java/com/qiuguo/iot/gateway/filter/AuthFilter.java b/iot-gateway/src/main/java/com/qiuguo/iot/gateway/filter/AuthFilter.java index f39604c..43f76f7 100644 --- a/iot-gateway/src/main/java/com/qiuguo/iot/gateway/filter/AuthFilter.java +++ b/iot-gateway/src/main/java/com/qiuguo/iot/gateway/filter/AuthFilter.java @@ -46,19 +46,20 @@ public class AuthFilter implements GlobalFilter, Ordered { if (ObjectUtils.isEmpty(api_token) || ObjectUtils.isEmpty(api_type)) { return Mono.error(new RuntimeException("未登录")); } - String key = RedisConstans.IOT_TOKEN.concat(api_token); - return reactiveRedisTemplate.getExpire(key).map(Duration::getSeconds).flatMap(ttl -> { - if (ttl == -1) { - // 用户没登陆 - return Mono.error(new RuntimeException("未登录")); - } else if (ttl <= 3600) { - // token 将要失效 - return reactiveRedisTemplate.expire(key, Duration.ofDays(7)).then(chain.filter(exchange)); - } else { - // 正常登录 - return chain.filter(exchange); - } - }); + return chain.filter(exchange); + // String key = RedisConstans.IOT_TOKEN.concat(api_token); + // return reactiveRedisTemplate.getExpire(key).map(Duration::getSeconds).flatMap(ttl -> { + // if (ttl == -1) { + // // 用户没登陆 + // return Mono.error(new RuntimeException("未登录")); + // } else if (ttl <= 3600) { + // // token 将要失效 + // return reactiveRedisTemplate.expire(key, Duration.ofDays(7)).then(chain.filter(exchange)); + // } else { + // // 正常登录 + // return chain.filter(exchange); + // } + // }); }