diff --git a/mall-admin/pom.xml b/mall-admin/pom.xml index 214d760..f2dd777 100644 --- a/mall-admin/pom.xml +++ b/mall-admin/pom.xml @@ -28,6 +28,10 @@ com.macro.mall mall-mbg + + org.springframework.boot + spring-boot-starter-web + org.springframework.boot spring-boot-starter-security diff --git a/mall-demo/pom.xml b/mall-demo/pom.xml index 0436244..e2e4353 100644 --- a/mall-demo/pom.xml +++ b/mall-demo/pom.xml @@ -26,6 +26,10 @@ com.macro.mall mall-mbg + + org.springframework.boot + spring-boot-starter-web + org.springframework.cloud spring-cloud-starter-netflix-eureka-client diff --git a/mall-gateway/pom.xml b/mall-gateway/pom.xml index 1e569a2..879f34d 100644 --- a/mall-gateway/pom.xml +++ b/mall-gateway/pom.xml @@ -21,7 +21,7 @@ org.springframework.cloud - spring-cloud-starter-netflix-zuul + spring-cloud-starter-gateway diff --git a/mall-gateway/src/main/java/com/macro/mall/MallGatewayApplication.java b/mall-gateway/src/main/java/com/macro/mall/MallGatewayApplication.java index eb0d2cd..5025e6a 100644 --- a/mall-gateway/src/main/java/com/macro/mall/MallGatewayApplication.java +++ b/mall-gateway/src/main/java/com/macro/mall/MallGatewayApplication.java @@ -3,9 +3,7 @@ package com.macro.mall; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.netflix.zuul.EnableZuulProxy; -@EnableZuulProxy @EnableDiscoveryClient @SpringBootApplication public class MallGatewayApplication { diff --git a/mall-gateway/src/main/resources/application.yml b/mall-gateway/src/main/resources/application.yml index 96070f3..38ccf36 100644 --- a/mall-gateway/src/main/resources/application.yml +++ b/mall-gateway/src/main/resources/application.yml @@ -3,16 +3,17 @@ server: spring: application: name: mall-gateway + cloud: + gateway: + discovery: + locator: + enabled: true + lower-case-service-id: true #使用小写service-id eureka: client: - register-with-eureka: true - fetch-registry: true service-url: defaultZone: http://localhost:8001/eureka/ registry-fetch-interval-seconds: 10 -zuul: - sensitive-headers: #默认会过滤Cookie,Set-Cookie,Authorization,配置为空不过滤 - add-host-header: true #设置为true重定向是会添加host请求头 management: #开启SpringBoot Admin的监控 endpoints: web: @@ -21,3 +22,6 @@ management: #开启SpringBoot Admin的监控 endpoint: health: show-details: always +logging: + level: + org.springframework.cloud.gateway: debug diff --git a/mall-monitor/pom.xml b/mall-monitor/pom.xml index 9ef7620..2a76fe9 100644 --- a/mall-monitor/pom.xml +++ b/mall-monitor/pom.xml @@ -15,6 +15,10 @@ + + org.springframework.boot + spring-boot-starter-web + org.springframework.cloud spring-cloud-starter-netflix-eureka-client diff --git a/mall-portal/pom.xml b/mall-portal/pom.xml index 8ebe985..96a0fa3 100644 --- a/mall-portal/pom.xml +++ b/mall-portal/pom.xml @@ -29,6 +29,10 @@ com.macro.mall mall-mbg + + org.springframework.boot + spring-boot-starter-web + org.springframework.boot spring-boot-starter-security diff --git a/mall-search/pom.xml b/mall-search/pom.xml index 8c354c2..6dce0c7 100644 --- a/mall-search/pom.xml +++ b/mall-search/pom.xml @@ -29,6 +29,10 @@ com.macro.mall mall-mbg + + org.springframework.boot + spring-boot-starter-web + org.springframework.boot spring-boot-starter-data-elasticsearch diff --git a/pom.xml b/pom.xml index 8800da5..f26f278 100644 --- a/pom.xml +++ b/pom.xml @@ -50,10 +50,6 @@ - - org.springframework.boot - spring-boot-starter-web - org.springframework.boot spring-boot-starter-actuator