前端访问地址: // api接口请求地址
window.SITE_CONFIG['baseUrl'] = 'http://localhost:88/api';
网关配置:
spring:
application:
name: gulimall-gateway
cloud:
nacos:
discovery:
server-addr: 192.168.43.236:8848
gateway:
discovery:
locator:
enabled: true
lowerCaseServiceId: true
filters:
- StripPrefix=1
routes:
- id: admin_route
uri: lb://renren-fast
predicates:
- Path=/api/**
filters:
- RewritePath=/api/(?<segment>.*),/renren-fast/$\{segment}
server:
port: 88
bootstarp.properties配置:
spring.application.name=gulimall-gateway
spring.cloud.nacos.config.server-addr=192.168.43.236:8848
spring.cloud.nacos.discovery.server-addr=192.168.43.236:8848