修改服务名称映射
This commit is contained in:
@ -24,15 +24,15 @@ public class CustomRouteConfig {
|
|||||||
@Bean
|
@Bean
|
||||||
public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
|
public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
|
||||||
return builder.routes()
|
return builder.routes()
|
||||||
.route("sczx_user", r -> r.path("/zc/user/**")
|
.route("sczx-user", r -> r.path("/zc/user/**")
|
||||||
.filters(f -> f.rewritePath("/zc/user/(?<segment>.*)", "/${segment}"))
|
.filters(f -> f.rewritePath("/zc/user/(?<segment>.*)", "/${segment}"))
|
||||||
.uri(uriWithCustomLoadBalance("sczx_user")))
|
.uri(uriWithCustomLoadBalance("sczx-user")))
|
||||||
.route("sczx_store", r -> r.path("/zc/store/**")
|
.route("sczx-store", r -> r.path("/zc/store/**")
|
||||||
.filters(f -> f.rewritePath("/zc/store/(?<segment>.*)", "/${segment}"))
|
.filters(f -> f.rewritePath("/zc/store/(?<segment>.*)", "/${segment}"))
|
||||||
.uri(uriWithCustomLoadBalance("sczx_store")))
|
.uri(uriWithCustomLoadBalance("sczx-store")))
|
||||||
.route("sczx_car", r -> r.path("/zc/car/**")
|
.route("sczx-car", r -> r.path("/zc/car/**")
|
||||||
.filters(f -> f.rewritePath("/zc/car/(?<segment>.*)", "/${segment}"))
|
.filters(f -> f.rewritePath("/zc/car/(?<segment>.*)", "/${segment}"))
|
||||||
.uri(uriWithCustomLoadBalance("sczx_car")))
|
.uri(uriWithCustomLoadBalance("sczx-car")))
|
||||||
.build();
|
.build();
|
||||||
// .route("sczx_user", r -> r.path("/zc/user/**")
|
// .route("sczx_user", r -> r.path("/zc/user/**")
|
||||||
// .uri("lb://sczx_user"))
|
// .uri("lb://sczx_user"))
|
||||||
|
|||||||
@ -4,7 +4,7 @@ server:
|
|||||||
|
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: sczx_gateway
|
name: sczx-gateway
|
||||||
cloud:
|
cloud:
|
||||||
# gateway:
|
# gateway:
|
||||||
# discovery:
|
# discovery:
|
||||||
|
|||||||
Reference in New Issue
Block a user