瀏覽代碼

Swagger配置修改

macro 1 年之前
父節點
當前提交
3a63e17467
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      mall-common/src/main/java/com/macro/mall/common/config/BaseSwaggerConfig.java

+ 1 - 1
mall-common/src/main/java/com/macro/mall/common/config/BaseSwaggerConfig.java

@@ -69,7 +69,7 @@ public abstract class BaseSwaggerConfig {
     private SecurityContext getContextByPath(String pathRegex) {
         return SecurityContext.builder()
                 .securityReferences(defaultAuth())
-                .forPaths(PathSelectors.regex(pathRegex))
+                .operationSelector(oc -> oc.requestMappingPattern().matches(pathRegex))
                 .build();
     }