qihang-ecom-erp-open/api/gateway/src/main/resources/application.yaml

67 lines
1.9 KiB
YAML

server:
port: 8088
spring:
application:
name: gateway
# security:
# user:
# name: admin
# password: password
basic:
enabled: true
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
# username: nacos
# password: nacos
sentinel:
transport:
dashboard: 127.0.0.1:8888 # sentinel控制台地址
gateway:
discovery:
locator:
enabled: true
routes:
- id: oms_api_route
uri: lb://oms-api
predicates:
- Path=/api/oms-api/**
filters:
- StripPrefix=2
- id: open_api_route
uri: lb://open-api
predicates:
- Path=/api/open-api/**
filters:
- StripPrefix=2
- id: sys_api_route
uri: lb://sys-api
predicates:
- Path=/api/sys-api/**
filters:
- StripPrefix=2
# - TokenFilter
# default-filters:
# - TokenFilter
# - name: Security # 添加安全过滤器
# args:
# springSecurityFilterChain: # 配置Spring Security过滤器链
# order: 0
# securityMatcher: org.springframework.security.web.util.matcher.AntPathRequestMatcher
# securityFilter: org.springframework.security.web.server.SecurityWebFilterChainFilter
# securityContextRepository: org.springframework.security.web.server.context.ServerSecurityContextRepository
# serverAccessDeniedHandler: org.springframework.security.web.server.access.AccessDeniedHandlerImpl
# serverAuthenticationEntryPoint: org.springframework.security.web.server.authentication.BasicAuthenticationEntryPoint
## 授权规则
#security:
# rules:
# - pattern: /api/tao-service/** # 定义需要授权的URL模式
#eureka:
# client:
# serviceUrl:
# defaultZone: http://127.0.0.1:8761/eureka/