server:
  port: 8080

spring:
  application:
    name: hzhub-gateway
  
  cloud:
    gateway:
      # 路由配置
      routes:
        # AI服务路由
        - id: hzhub-ai
          uri: http://localhost:8081
          predicates:
            - Path=/ai/**
          filters:
            - StripPrefix=1
        
        # ERP服务路由
        - id: hzhub-erp
          uri: http://localhost:8082
          predicates:
            - Path=/erp/**
          filters:
            - StripPrefix=1
        
        # 系统服务路由
        - id: hzhub-system
          uri: http://localhost:8081
          predicates:
            - Path=/system/**
          filters:
            - StripPrefix=1
      
      # 全局默认过滤器
      default-filters:
        - DedupeResponseHeader=Access-Control-Allow-Credentials Access-Control-Allow-Origin
      
      # 跨域配置
      globalcors:
        cors-configurations:
          '[/**]':
            allowedOrigins: "*"
            allowedMethods: "*"
            allowedHeaders: "*"
            allowCredentials: true

# Sa-Token配置
sa-token:
  token-name: Authorization
  timeout: 86400
  activity-timeout: -1
  is-concurrent: true
  is-share: false
  token-style: uuid
  is-log: false

# 日志配置
logging:
  level:
    org.springframework.cloud.gateway: debug
