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