From 83b3eb487fc512775d1cd12498c3148709aeceb2 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 4 Mar 2023 14:58:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20Swagger=20=E7=9A=84?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=BE=9D=E8=B5=96=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-dependencies/pom.xml | 36 ++++++++++++++++--- yudao-framework/yudao-common/pom.xml | 6 ++-- .../yudao-spring-boot-starter-web/pom.xml | 25 ++++++------- .../config/SecurityConfiguration.java | 6 +--- .../src/main/resources/application.yaml | 8 ++--- 5 files changed, 52 insertions(+), 29 deletions(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 45c1ee9996..411dabf165 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -18,9 +18,10 @@ 2.7.8 + 2.5 + 2.2.8 1.6.14 4.0.0 - 2.5 1.2.15 3.5.3.1 @@ -171,15 +172,40 @@ - com.github.xiaoymin - knife4j-openapi3-spring-boot-starter - ${knife4j.version} + io.swagger.core.v3 + swagger-annotations + ${swagger.version} - org.springdoc + io.swagger.core.v3 + swagger-models + ${swagger.version} + + + org.springdoc + springdoc-openapi-common + ${springdoc.version} + + + org.springdoc + springdoc-openapi-webmvc-core + ${springdoc.version} + + + org.springdoc + springdoc-openapi-webflux-core + ${springdoc.version} + + + org.springdoc springdoc-openapi-ui ${springdoc.version} + + com.github.xiaoymin + knife4j-openapi3-spring-boot-starter + ${knife4j.version} + diff --git a/yudao-framework/yudao-common/pom.xml b/yudao-framework/yudao-common/pom.xml index 7601603302..da8510ec2a 100644 --- a/yudao-framework/yudao-common/pom.xml +++ b/yudao-framework/yudao-common/pom.xml @@ -59,9 +59,9 @@ - org.springdoc - springdoc-openapi-ui - provided + io.swagger.core.v3 + swagger-annotations + provided diff --git a/yudao-framework/yudao-spring-boot-starter-web/pom.xml b/yudao-framework/yudao-spring-boot-starter-web/pom.xml index e591cc3292..c68dec9e3c 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-web/pom.xml @@ -21,25 +21,17 @@ yudao-common - - - org.springframework.boot - spring-boot-starter-web - - + org.springframework.boot spring-boot-configuration-processor true + - com.github.xiaoymin - knife4j-openapi3-spring-boot-starter - - - org.springdoc - springdoc-openapi-ui + org.springframework.boot + spring-boot-starter-web @@ -48,6 +40,15 @@ provided + + com.github.xiaoymin + knife4j-openapi3-spring-boot-starter + + + org.springdoc + springdoc-openapi-ui + + cn.iocoder.boot diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java index 01b5714ba1..f43b7f3c8d 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java @@ -24,11 +24,7 @@ public class SecurityConfiguration { public void customize(ExpressionUrlAuthorizationConfigurer.ExpressionInterceptUrlRegistry registry) { // Swagger 接口文档 registry.antMatchers("/v3/api-docs/**").permitAll() - .antMatchers("/swagger-ui.html").permitAll() - .antMatchers("/swagger-ui/**").permitAll() - .antMatchers("/swagger-resources/**").anonymous() - .antMatchers("/webjars/**").anonymous() - .antMatchers("/*/api-docs").anonymous(); + .antMatchers("/swagger-ui.html").permitAll(); // 积木报表 registry.antMatchers("/jmreport/**").permitAll(); // Spring Boot Actuator 的安全配置 diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index d7e1588850..fe56809b4b 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -39,14 +39,14 @@ spring: springdoc: api-docs: - enabled: true + enabled: true # 1. 是否开启 Swagger 接文档的元数据 path: /v3/api-docs swagger-ui: - enabled: true - path: /swagger-ui + enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面 + path: /swagger-ui.html knife4j: - enable: true + enable: true # 2.2 是否开启 Swagger 文档的 Knife4j UI 界面 setting: language: zh_cn