From b4e68fa018d143d78336fe6b7f1f2c9afc229c1e Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 11 Nov 2022 23:16:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=20Gateway=20Swagger=20?= =?UTF-8?q?=E7=9A=84=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=8E=BB=E9=99=A4=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../YudaoWebSecurityConfigurerAdapter.java | 1 - yudao-gateway/pom.xml | 22 ++++++++----------- .../src/main/resources/application.yaml | 8 +------ 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java index 917697b3f..7c50bbafa 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java @@ -127,7 +127,6 @@ public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdap .antMatchers(HttpMethod.DELETE, permitAllUrls.get(HttpMethod.DELETE).toArray(new String[0])).permitAll() // 基于 yudao.security.permit-all-urls 无需认证 .antMatchers(securityProperties.getPermitAllUrls().toArray(new String[0])).permitAll() - .antMatchers("/captcha/get", "/captcha/check").permitAll() // 设置 App API 无需认证 .antMatchers(buildAppApi("/**")).permitAll() // ②:每个项目的自定义规则 diff --git a/yudao-gateway/pom.xml b/yudao-gateway/pom.xml index c50b86536..7c16b6658 100644 --- a/yudao-gateway/pom.xml +++ b/yudao-gateway/pom.xml @@ -44,6 +44,15 @@ javax.servlet-api + + com.github.xiaoymin + knife4j-spring-boot-starter + + + io.swagger + swagger-annotations + + org.springframework.cloud @@ -68,19 +77,6 @@ yudao-spring-boot-starter-monitor - - com.github.xiaoymin - knife4j-spring-boot-starter - - - io.swagger - swagger-annotations - - - io.springfox - springfox-boot-starter - 3.0.0 - diff --git a/yudao-gateway/src/main/resources/application.yaml b/yudao-gateway/src/main/resources/application.yaml index 5689d0ccc..222dc29d9 100644 --- a/yudao-gateway/src/main/resources/application.yaml +++ b/yudao-gateway/src/main/resources/application.yaml @@ -5,12 +5,6 @@ spring: cloud: # Spring Cloud Gateway 配置项,对应 GatewayProperties 类 gateway: - discovery: - locator: - # gateway开启服务注册和发现的功能, - enabled: true - # 将请求路径上的服务名配置为小写(因为服务注册的时候,向注册中心注册时将服务名转成大写的了) - lowerCaseServiceId: true # 路由配置项,对应 RouteDefinition 数组 routes: - id: system-admin-api # 路由的编号 @@ -30,7 +24,7 @@ spring: predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组 - Path=/admin-api/infra/** filters: - - RewritePath=/admin-api/infram/v2/api-docs, /v2/api-docs + - RewritePath=/admin-api/infra/v2/api-docs, /v2/api-docs - id: infra-app-api # 路由的编号 uri: grayLb://infra-server predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组