fix:gateway ready
This commit is contained in:
parent
44b8a704b3
commit
1df2d374c7
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.3.5</version>
|
<version>2.7.18</version>
|
||||||
<relativePath/>
|
<relativePath/>
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>com.ensign</groupId>
|
<groupId>com.ensign</groupId>
|
||||||
@ -15,7 +15,8 @@
|
|||||||
<description>ensign-gateway</description>
|
<description>ensign-gateway</description>
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>8</java.version>
|
<java.version>8</java.version>
|
||||||
<spring-cloud.version>2023.0.3</spring-cloud.version>
|
<spring-cloud.version>2021.0.8</spring-cloud.version>
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -6,7 +6,6 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
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.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.HttpStatusCode;
|
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.reactive.function.client.WebClient;
|
import org.springframework.web.reactive.function.client.WebClient;
|
||||||
@ -54,7 +53,7 @@ public class ProxyFilter implements GlobalFilter {
|
|||||||
.header("userId", userId)
|
.header("userId", userId)
|
||||||
.accept(MediaType.APPLICATION_JSON)
|
.accept(MediaType.APPLICATION_JSON)
|
||||||
.retrieve()
|
.retrieve()
|
||||||
.onStatus(HttpStatusCode::is4xxClientError, response -> {
|
.onStatus(HttpStatus::is4xxClientError, response -> {
|
||||||
log.error(response.statusCode().toString());
|
log.error(response.statusCode().toString());
|
||||||
return Mono.error(new RuntimeException("Unauthorized"));
|
return Mono.error(new RuntimeException("Unauthorized"));
|
||||||
})
|
})
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
server:
|
server:
|
||||||
port: 48080
|
port: 38080
|
||||||
|
|
||||||
--- #################### 数据库相关配置 ####################
|
--- #################### 数据库相关配置 ####################
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user