pull/1/MERGE
tanghc 5 years ago
parent 7b7ccf0e08
commit d76c5a5963
  1. 3
      sop-common/sop-bridge-gateway/src/main/java/com/gitee/sop/bridge/SopGatewayAutoConfiguration.java
  2. 2
      sop-common/sop-bridge-gateway/src/main/resources/sop-bridge.properties
  3. 4
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/configuration/BaseGatewayConfiguration.java

@ -1,6 +1,8 @@
package com.gitee.sop.bridge; package com.gitee.sop.bridge;
import com.gitee.sop.gatewaycommon.gateway.configuration.AlipayGatewayConfiguration; import com.gitee.sop.gatewaycommon.gateway.configuration.AlipayGatewayConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.cloud.netflix.ribbon.RibbonAutoConfiguration;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
@ -10,5 +12,6 @@ import org.springframework.context.annotation.Import;
*/ */
@Configuration @Configuration
@Import(AlipayGatewayConfiguration.class) @Import(AlipayGatewayConfiguration.class)
@AutoConfigureBefore(RibbonAutoConfiguration.class)
public class SopGatewayAutoConfiguration { public class SopGatewayAutoConfiguration {
} }

@ -6,8 +6,6 @@ sop.secret=MZZOUSTua6LzApIWXCwEgbBmxSzpzC
# 网关入口 # 网关入口
sop.gateway-index-path=/ sop.gateway-index-path=/
spring.main.allow-bean-definition-overriding=true
# nacos cloud配置 # nacos cloud配置
spring.cloud.nacos.discovery.server-addr=${nacos.url} spring.cloud.nacos.discovery.server-addr=${nacos.url}

@ -123,9 +123,8 @@ public class BaseGatewayConfiguration extends AbstractConfiguration {
* @param clientFactory * @param clientFactory
* @return * @return
*/ */
@Primary
@Bean @Bean
LoadBalancerClient sopLoadBalancerClient(SpringClientFactory clientFactory) { LoadBalancerClient loadBalancerClient(SpringClientFactory clientFactory) {
return new SopLoadBalancerClient(clientFactory); return new SopLoadBalancerClient(clientFactory);
} }
@ -135,7 +134,6 @@ public class BaseGatewayConfiguration extends AbstractConfiguration {
* @param loadBalancerProperties loadBalancerProperties * @param loadBalancerProperties loadBalancerProperties
* @return * @return
*/ */
@Primary
@Bean @Bean
LoadBalancerClientFilter loadBalancerClientFilter(LoadBalancerClient sopLoadBalancerClient, LoadBalancerProperties loadBalancerProperties) { LoadBalancerClientFilter loadBalancerClientFilter(LoadBalancerClient sopLoadBalancerClient, LoadBalancerProperties loadBalancerProperties) {
return new SopLoadBalancerClientFilter(sopLoadBalancerClient, loadBalancerProperties); return new SopLoadBalancerClientFilter(sopLoadBalancerClient, loadBalancerProperties);

Loading…
Cancel
Save