简化 Gateway Swagger 的配置,去除无用的
parent
9399f36232
commit
b4e68fa018
|
@ -127,7 +127,6 @@ public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdap
|
||||||
.antMatchers(HttpMethod.DELETE, permitAllUrls.get(HttpMethod.DELETE).toArray(new String[0])).permitAll()
|
.antMatchers(HttpMethod.DELETE, permitAllUrls.get(HttpMethod.DELETE).toArray(new String[0])).permitAll()
|
||||||
// 基于 yudao.security.permit-all-urls 无需认证
|
// 基于 yudao.security.permit-all-urls 无需认证
|
||||||
.antMatchers(securityProperties.getPermitAllUrls().toArray(new String[0])).permitAll()
|
.antMatchers(securityProperties.getPermitAllUrls().toArray(new String[0])).permitAll()
|
||||||
.antMatchers("/captcha/get", "/captcha/check").permitAll()
|
|
||||||
// 设置 App API 无需认证
|
// 设置 App API 无需认证
|
||||||
.antMatchers(buildAppApi("/**")).permitAll()
|
.antMatchers(buildAppApi("/**")).permitAll()
|
||||||
// ②:每个项目的自定义规则
|
// ②:每个项目的自定义规则
|
||||||
|
|
|
@ -44,6 +44,15 @@
|
||||||
<artifactId>javax.servlet-api</artifactId>
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-annotations</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- RPC 远程调用相关 -->
|
<!-- RPC 远程调用相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
@ -68,19 +77,6 @@
|
||||||
<artifactId>yudao-spring-boot-starter-monitor</artifactId>
|
<artifactId>yudao-spring-boot-starter-monitor</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.xiaoymin</groupId>
|
|
||||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.swagger</groupId>
|
|
||||||
<artifactId>swagger-annotations</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.springfox</groupId>
|
|
||||||
<artifactId>springfox-boot-starter</artifactId>
|
|
||||||
<version>3.0.0</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,6 @@ spring:
|
||||||
cloud:
|
cloud:
|
||||||
# Spring Cloud Gateway 配置项,对应 GatewayProperties 类
|
# Spring Cloud Gateway 配置项,对应 GatewayProperties 类
|
||||||
gateway:
|
gateway:
|
||||||
discovery:
|
|
||||||
locator:
|
|
||||||
# gateway开启服务注册和发现的功能,
|
|
||||||
enabled: true
|
|
||||||
# 将请求路径上的服务名配置为小写(因为服务注册的时候,向注册中心注册时将服务名转成大写的了)
|
|
||||||
lowerCaseServiceId: true
|
|
||||||
# 路由配置项,对应 RouteDefinition 数组
|
# 路由配置项,对应 RouteDefinition 数组
|
||||||
routes:
|
routes:
|
||||||
- id: system-admin-api # 路由的编号
|
- id: system-admin-api # 路由的编号
|
||||||
|
@ -30,7 +24,7 @@ spring:
|
||||||
predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组
|
predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组
|
||||||
- Path=/admin-api/infra/**
|
- Path=/admin-api/infra/**
|
||||||
filters:
|
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 # 路由的编号
|
- id: infra-app-api # 路由的编号
|
||||||
uri: grayLb://infra-server
|
uri: grayLb://infra-server
|
||||||
predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组
|
predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组
|
||||||
|
|
Loading…
Reference in New Issue