server:
  #开启优雅停机
  shutdown: graceful
  port: 9999
  servlet:
    context-path: /api
  tomcat:
    uri-encoding: UTF-8
    threads:
      max: 800
      min-spare: 100
spring:
  servlet:
    multipart:
      # 修改上传文件临时路径为 /data1/tmp
      location: /data1/tmp
      max-file-size: 100MB
      max-request-size: 100MB
  application:
    name: @artifactId@
  main:
    allow-circular-references: true
    allow-bean-definition-overriding: true
  cloud:
    loadbalancer:
      retry:
        enabled: true
    gateway:
      discovery:
        locator:
          # 配置之后访问时无需大写
          lower-case-service-id: true
          enabled: true  # 是否开启，默认为 false 关闭
      # 跨域配置
      globalcors:
        corsConfigurations:
          '[/**]':
            allowedOrigins: '*'
            allowedHeaders: '*'
            allowedMethods:
              - GET
              - HEAD
              - POST
              - PUT
              - DELETE
              - OPTIONS
        add-to-simple-url-handler-mapping: true
      routes:
        # 认证中心
        - id: auth-service
          uri: lb://auth-service
          predicates:
            - Path=/api/auth/**
          filters:
            - StripPrefix=1
            # 验证码处理
            - CacheRequestFilter
            - ValidateCodeFilter
        # 系统模块
        - id: system-service
          uri: lb://system-service
          predicates:
            - Path=/api/system/**
          filters:
            - StripPrefix=1
        # 定时任务
        - id: job-service
          uri: lb://job-service
          predicates:
            - Path=/api/job/**
          filters:
            - StripPrefix=1
#      default-filters:
#        - name: BlackListUrlFilter
#          args:
#            blacklistUrl:
#              - /test
      #  - DedupeResponseHeader=Access-Control-Allow-Credentials Access-Control-Allow-Origin
      #  # 默认限流
      #  - name: RequestRateLimiter
      #    args:
      #      # how many requests per second you want a user to be allowed to do, without any dropped requests
      #      # 每秒允许用户执行多少请求，不允许删除任何请求，这是令牌桶被填满的速率
      #      redis-rate-limiter.replenishRate: 10
      #      # the maximum number of requests a user is allowed to do in a single second
      #      # 用户在一秒钟内允许执行的最大请求数，这是令牌桶可以容纳的令牌数量。将此值设置为0将阻止所有请求。
      #      redis-rate-limiter.burstCapacity: 20
      #      # how many tokens a request costs. This is the number of tokens taken from the bucket for each request and defaults to 1.
      #      # 一个请求需要多少令牌 这是为每个请求从桶中获取的令牌数量，默认为1。
      #      redis-rate-limiter.requestedTokens: 1
      #      key-resolver: "#{@remoteAddrKeyResolver}"


# 安全配置
security:
  # 验证码
  captcha:
    enabled: true
    type: char
  # 防止XSS攻击
  xss:
    enabled: true
    #excludeUrls:
    #  - /api/auth/login
  # 不校验白名单
  ignore:
    whites:
      - /auth/logout
      - /auth/login
      - /auth/register
      - /feign/**
      - /demo/**
logging:
  config: classpath:logback-nacos.xml


