修改配置
This commit is contained in:
parent
9e4640376a
commit
7f06574ce9
16
pom.xml
16
pom.xml
|
|
@ -29,6 +29,8 @@
|
||||||
<lombok.version>1.18.30</lombok.version>
|
<lombok.version>1.18.30</lombok.version>
|
||||||
<jjwt.version>0.11.5</jjwt.version>
|
<jjwt.version>0.11.5</jjwt.version>
|
||||||
<resilience4j.version>2.1.0</resilience4j.version>
|
<resilience4j.version>2.1.0</resilience4j.version>
|
||||||
|
<springdoc.version>2.3.0</springdoc.version>
|
||||||
|
<commons-lang3.version>3.14.0</commons-lang3.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
|
@ -93,6 +95,20 @@
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringDoc -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
|
<version>${springdoc.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Commons Lang3 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>${commons-lang3.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Resilience4j -->
|
<!-- Resilience4j -->
|
||||||
<!-- Spring Boot 3集成模块,提供自动配置、注解支持和健康指标,是与Spring Boot集成的核心依赖 -->
|
<!-- Spring Boot 3集成模块,提供自动配置、注解支持和健康指标,是与Spring Boot集成的核心依赖 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -34,16 +34,6 @@
|
||||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring Cloud Alibaba -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MyBatis Plus -->
|
<!-- MyBatis Plus -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
|
|
@ -61,7 +51,6 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springdoc</groupId>
|
<groupId>org.springdoc</groupId>
|
||||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
<version>2.3.0</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Common Module -->
|
<!-- Common Module -->
|
||||||
|
|
@ -75,6 +64,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>${lombok.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: tacit-admin
|
name: tacit-admin
|
||||||
|
config:
|
||||||
|
import:
|
||||||
|
- nacos: # 添加此行
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
|
|
|
||||||
|
|
@ -34,16 +34,6 @@
|
||||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring Cloud Alibaba -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MyBatis Plus -->
|
<!-- MyBatis Plus -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
|
|
@ -61,7 +51,6 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springdoc</groupId>
|
<groupId>org.springdoc</groupId>
|
||||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
<version>2.3.0</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Common Module -->
|
<!-- Common Module -->
|
||||||
|
|
@ -75,6 +64,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>${lombok.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: tacit-app-api
|
name: tacit-app-api
|
||||||
|
config:
|
||||||
|
import:
|
||||||
|
- nacos: # 添加此行
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
|
|
|
||||||
|
|
@ -20,16 +20,6 @@
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring Cloud -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Spring Cloud Alibaba -->
|
<!-- Spring Cloud Alibaba -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
|
@ -40,17 +30,16 @@
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- MyBatis Plus -->
|
<!-- Spring Cloud Bootstrap (Required for Spring Boot 3.x to load bootstrap.yml) -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Database -->
|
<!-- Feign -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.oceanbase</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>oceanbase-client</artifactId>
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
<version>2.4.0</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- JJWT -->
|
<!-- JJWT -->
|
||||||
|
|
@ -81,6 +70,24 @@
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Commons Lang3 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Testing -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-engine</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
||||||
|
|
@ -44,4 +44,8 @@ public class ResponseResult<T> implements Serializable {
|
||||||
public static <T> ResponseResult<T> fail(Integer code, String message) {
|
public static <T> ResponseResult<T> fail(Integer code, String message) {
|
||||||
return new ResponseResult<>(code, message, null);
|
return new ResponseResult<>(code, message, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return this.code == 200;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,16 +20,6 @@
|
||||||
<artifactId>spring-cloud-starter-gateway</artifactId>
|
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring Cloud Alibaba -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Spring Security -->
|
<!-- Spring Security -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|
@ -41,26 +31,33 @@
|
||||||
<groupId>com.tacit</groupId>
|
<groupId>com.tacit</groupId>
|
||||||
<artifactId>tacit-common</artifactId>
|
<artifactId>tacit-common</artifactId>
|
||||||
<version>${project.parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring Cloud Bootstrap for loading bootstrap.yml in Spring Boot 3.x -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Lombok -->
|
<!-- Lombok -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>${lombok.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Commons Lang3 -->
|
<!-- Testing -->
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-lang3</artifactId>
|
|
||||||
<version>3.14.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Logging -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-logging</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
@ -72,7 +69,18 @@
|
||||||
<version>${spring-boot.version}</version>
|
<version>${spring-boot.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<skip>false</skip>
|
<skip>false</skip>
|
||||||
|
<mainClass>com.tacit.gateway.GatewayApplication</mainClass>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<mainClass>com.tacit.gateway.GatewayApplication</mainClass>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,10 @@ import com.tacit.common.constant.CommonConstant;
|
||||||
import com.tacit.common.utils.JwtUtils;
|
import com.tacit.common.utils.JwtUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.cloud.gateway.filter.GatewayFilter;
|
||||||
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
||||||
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||||
|
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
|
||||||
import org.springframework.core.Ordered;
|
import org.springframework.core.Ordered;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
@ -17,9 +19,12 @@ import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Component
|
/**
|
||||||
|
* JWT 认证过滤器 - 作为 GatewayFilterFactory 使用
|
||||||
|
*/
|
||||||
|
@Component("JwtAuthenticationFilter")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class JwtAuthenticationFilter implements GlobalFilter, Ordered {
|
public class JwtAuthenticationFilter extends AbstractGatewayFilterFactory<JwtAuthenticationFilter.Config> {
|
||||||
|
|
||||||
// 不需要认证的路径
|
// 不需要认证的路径
|
||||||
private static final List<String> WHITE_LIST = List.of(
|
private static final List<String> WHITE_LIST = List.of(
|
||||||
|
|
@ -29,54 +34,63 @@ public class JwtAuthenticationFilter implements GlobalFilter, Ordered {
|
||||||
"/v3/api-docs"
|
"/v3/api-docs"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
public JwtAuthenticationFilter() {
|
||||||
|
super(Config.class);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
public GatewayFilter apply(Config config) {
|
||||||
ServerHttpRequest request = exchange.getRequest();
|
return new GatewayFilter() {
|
||||||
String path = request.getURI().getPath();
|
@Override
|
||||||
|
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
||||||
|
ServerHttpRequest request = exchange.getRequest();
|
||||||
|
String path = request.getURI().getPath();
|
||||||
|
|
||||||
// 检查是否在白名单中
|
// 检查是否在白名单中
|
||||||
if (isWhiteList(path)) {
|
if (isWhiteList(path)) {
|
||||||
return chain.filter(exchange);
|
return chain.filter(exchange);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取Authorization头
|
// 获取Authorization头
|
||||||
HttpHeaders headers = request.getHeaders();
|
HttpHeaders headers = request.getHeaders();
|
||||||
String authorization = headers.getFirst(HttpHeaders.AUTHORIZATION);
|
String authorization = headers.getFirst(HttpHeaders.AUTHORIZATION);
|
||||||
|
|
||||||
// 检查Authorization头是否存在
|
// 检查Authorization头是否存在
|
||||||
if (StringUtils.isBlank(authorization)) {
|
if (StringUtils.isBlank(authorization)) {
|
||||||
return unauthorizedResponse(exchange, "缺少认证令牌");
|
return unauthorizedResponse(exchange, "缺少认证令牌");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查Authorization头格式
|
// 检查Authorization头格式
|
||||||
if (!authorization.startsWith(CommonConstant.JWT_PREFIX)) {
|
if (!authorization.startsWith(CommonConstant.JWT_PREFIX)) {
|
||||||
return unauthorizedResponse(exchange, "认证令牌格式错误");
|
return unauthorizedResponse(exchange, "认证令牌格式错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提取JWT令牌
|
// 提取JWT令牌
|
||||||
String token = authorization.substring(CommonConstant.JWT_PREFIX.length());
|
String token = authorization.substring(CommonConstant.JWT_PREFIX.length());
|
||||||
|
|
||||||
// 验证JWT令牌
|
// 验证JWT令牌
|
||||||
try {
|
try {
|
||||||
JwtUtils.validateToken(token);
|
JwtUtils.validateToken(token);
|
||||||
|
|
||||||
// 从令牌中获取用户信息并添加到请求头
|
// 从令牌中获取用户信息并添加到请求头
|
||||||
Long userId = JwtUtils.getUserIdFromToken(token);
|
Long userId = JwtUtils.getUserIdFromToken(token);
|
||||||
String username = JwtUtils.getUsernameFromToken(token);
|
String username = JwtUtils.getUsernameFromToken(token);
|
||||||
String role = JwtUtils.getRoleFromToken(token);
|
String role = JwtUtils.getRoleFromToken(token);
|
||||||
|
|
||||||
// 将用户信息添加到请求头
|
// 将用户信息添加到请求头
|
||||||
ServerHttpRequest mutatedRequest = request.mutate()
|
ServerHttpRequest mutatedRequest = request.mutate()
|
||||||
.header("X-User-Id", String.valueOf(userId))
|
.header("X-User-Id", String.valueOf(userId))
|
||||||
.header("X-Username", username)
|
.header("X-Username", username)
|
||||||
.header("X-Role", role)
|
.header("X-Role", role)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return chain.filter(exchange.mutate().request(mutatedRequest).build());
|
return chain.filter(exchange.mutate().request(mutatedRequest).build());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("JWT认证失败: {}", e.getMessage());
|
log.error("JWT认证失败: {}", e.getMessage());
|
||||||
return unauthorizedResponse(exchange, e.getMessage());
|
return unauthorizedResponse(exchange, e.getMessage());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -97,8 +111,8 @@ public class JwtAuthenticationFilter implements GlobalFilter, Ordered {
|
||||||
return response.writeWith(Mono.just(response.bufferFactory().wrap(responseBody.getBytes())));
|
return response.writeWith(Mono.just(response.bufferFactory().wrap(responseBody.getBytes())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getOrder() {
|
public static class Config {
|
||||||
return -100;
|
// 可以添加配置属性
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
server:
|
|
||||||
port: 8080
|
|
||||||
|
|
||||||
spring:
|
|
||||||
cloud:
|
|
||||||
gateway:
|
|
||||||
discovery:
|
|
||||||
locator:
|
|
||||||
enabled: true
|
|
||||||
lower-case-service-id: true
|
|
||||||
routes:
|
|
||||||
# Admin Service Route
|
|
||||||
- id: tacit-admin
|
|
||||||
uri: lb://tacit-admin
|
|
||||||
predicates:
|
|
||||||
- Path=/admin/**
|
|
||||||
filters:
|
|
||||||
- StripPrefix=1
|
|
||||||
|
|
||||||
# App API Service Route
|
|
||||||
- id: tacit-app-api
|
|
||||||
uri: lb://tacit-app-api
|
|
||||||
predicates:
|
|
||||||
- Path=/api/**
|
|
||||||
filters:
|
|
||||||
- StripPrefix=1
|
|
||||||
- JwtAuthenticationFilter
|
|
||||||
|
|
||||||
# Swagger UI Routes
|
|
||||||
- id: swagger-admin
|
|
||||||
uri: lb://tacit-admin
|
|
||||||
predicates:
|
|
||||||
- Path=/swagger-admin/**
|
|
||||||
filters:
|
|
||||||
- StripPrefix=1
|
|
||||||
|
|
||||||
- id: swagger-app-api
|
|
||||||
uri: lb://tacit-app-api
|
|
||||||
predicates:
|
|
||||||
- Path=/swagger-app-api/**
|
|
||||||
filters:
|
|
||||||
- StripPrefix=1
|
|
||||||
|
|
||||||
# Logging Configuration
|
|
||||||
logging:
|
|
||||||
level:
|
|
||||||
org.springframework.cloud.gateway: debug
|
|
||||||
org.springframework.http.server.reactive: debug
|
|
||||||
org.springframework.web.reactive: debug
|
|
||||||
reactor.netty: debug
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: tacit-gateway
|
name: tacit-gateway
|
||||||
|
main:
|
||||||
|
web-application-type: reactive
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
|
enabled: true
|
||||||
server-addr: localhost:8848
|
server-addr: localhost:8848
|
||||||
namespace: public
|
username: nacos
|
||||||
|
password: nacos
|
||||||
config:
|
config:
|
||||||
|
enabled: true
|
||||||
server-addr: localhost:8848
|
server-addr: localhost:8848
|
||||||
namespace: public
|
file-extension: yaml
|
||||||
file-extension: yml
|
username: nacos
|
||||||
group: DEFAULT_GROUP
|
password: nacos
|
||||||
refresh-enabled: true
|
|
||||||
profiles:
|
|
||||||
active: dev
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue