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: erp_api_route
          uri: lb://erp-api
          predicates:
            - Path=/api/erp-api/**
          filters:
            - StripPrefix=2

        - id: oms_api_route
          uri: lb://oms-api
          predicates:
            - Path=/api/oms-api/**
          filters:
            - StripPrefix=2

        - id: ai_agent_route
          uri: lb://ai-agent
          predicates:
            - Path=/api/ai-agent/**
          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/