3
0

2 Коммиты a7bc60e803 ... fd532d6d84

Автор SHA1 Сообщение Дата
  李学强 fd532d6d84 广电回调消息 7 месяцев назад
  李学强 9f6089fb0d 网关更新 7 месяцев назад

+ 1 - 0
lhb-basic/lhb-basic-biz/src/main/java/com/kxs/lhb/basic/biz/service/impl/LhbOrderServiceImpl.java

@@ -421,6 +421,7 @@ public class LhbOrderServiceImpl extends MPJBaseServiceImpl<LhbOrderMapper, LhbO
     @Override
     public Object tongyiNotify(OrderInfoNotify param) {
 
+        log.info("收到广电统一订单消息:{}", JSONUtil.toJsonStr(param));
         LhbOrder order = getOrderSn(param.getOrderInfo().getOrderId());
         if(order == null){
             order = new LhbOrder();

+ 10 - 0
lhb-gateway/src/main/java/com/kxs/gateway/api/filter/RequestDecoderFilter.java

@@ -23,8 +23,10 @@ import org.springframework.http.MediaType;
 import org.springframework.http.server.reactive.ServerHttpRequest;
 import org.springframework.http.server.reactive.ServerHttpRequestDecorator;
 import org.springframework.http.server.reactive.ServerHttpResponse;
+import org.springframework.util.AntPathMatcher;
 import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
+import org.springframework.util.PathMatcher;
 import org.springframework.web.reactive.function.server.HandlerStrategies;
 import org.springframework.web.reactive.function.server.ServerRequest;
 import org.springframework.web.server.ServerWebExchange;
@@ -66,6 +68,9 @@ public class RequestDecoderFilter extends AbstractGatewayFilterFactory<Object> {
 
     private static final List<String> FILE_TYPES = List.of("multipart/form-data");
 
+
+    private final PathMatcher pathMatcher = new AntPathMatcher();
+
     @Override
     public GatewayFilter apply(Object config) {
         return (exchange, chain) -> {
@@ -79,6 +84,11 @@ public class RequestDecoderFilter extends AbstractGatewayFilterFactory<Object> {
             if (!filterUrl.isEmpty() && filterUrl.contains(path)) {
                 return chain.filter(exchange);
             }
+            boolean match = filterUrl.stream().anyMatch(url -> pathMatcher.match(url, path));
+            if (match) {
+                return chain.filter(exchange);
+            }
+
             if (contentType != null && FILE_TYPES.stream().anyMatch(contentType.toString()::startsWith)) {
                 // 这是一个文件请求
                 return chain.filter(exchange);