update 项目启动
This commit is contained in:
parent
9604164e0c
commit
f2fe17f274
6
pom.xml
6
pom.xml
|
|
@ -127,6 +127,12 @@
|
||||||
<artifactId>resilience4j-spring-boot3</artifactId>
|
<artifactId>resilience4j-spring-boot3</artifactId>
|
||||||
<version>${resilience4j.version}</version>
|
<version>${resilience4j.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 核心模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.github.resilience4j</groupId>
|
||||||
|
<artifactId>resilience4j-core</artifactId>
|
||||||
|
<version>${resilience4j.version}</version>
|
||||||
|
</dependency>
|
||||||
<!-- 断路器模式 -->
|
<!-- 断路器模式 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.github.resilience4j</groupId>
|
<groupId>io.github.resilience4j</groupId>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: tacit-admin
|
name: tacit-admin
|
||||||
main:
|
config:
|
||||||
web-application-type: reactive
|
import: "optional:nacos:${spring.application.name}.yaml"
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,18 @@
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jdbc</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.zaxxer</groupId>
|
||||||
|
<artifactId>HikariCP</artifactId>
|
||||||
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ package com.tacit.gateway.filter;
|
||||||
import com.tacit.common.constant.CommonConstant;
|
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.springframework.cloud.gateway.filter.GatewayFilter;
|
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;
|
||||||
|
|
@ -56,7 +55,7 @@ public class JwtAuthenticationFilter extends AbstractGatewayFilterFactory<JwtAut
|
||||||
String authorization = headers.getFirst(HttpHeaders.AUTHORIZATION);
|
String authorization = headers.getFirst(HttpHeaders.AUTHORIZATION);
|
||||||
|
|
||||||
// 检查Authorization头是否存在
|
// 检查Authorization头是否存在
|
||||||
if (StringUtils.isBlank(authorization)) {
|
if (authorization == null || authorization.isEmpty()) {
|
||||||
return unauthorizedResponse(exchange, "缺少认证令牌");
|
return unauthorizedResponse(exchange, "缺少认证令牌");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: tacit-gateway
|
name: tacit-gateway
|
||||||
|
config:
|
||||||
|
import: "optional:nacos:${spring.application.name}.yaml"
|
||||||
main:
|
main:
|
||||||
web-application-type: reactive
|
web-application-type: reactive
|
||||||
cloud:
|
cloud:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue