Gateway跨域解决可copy配置代码

      globalcors: # 全局跨域处理配置
        add-to-simple-url-handler-mapping: true # 解决options请求被拦截的问题
        cors-configurations:
          '[/**]':
            allowed-origins:
              - "http://localhost:8090"
              - "http://www.qvfan.com"
            allowedMethods:
              - "GET"
              - "POST"
              - "DELETE"
              - "PUT"
              - "OPTIONS"
            allowed-headers: "*"  # 允许在请求中携带头信息
            allowCredentials: true # 是否允许携带cookie
            maxAge: 360000 #这次跨域检测的有效期

Gateway跨域解决可copy配置代码_第1张图片

你可能感兴趣的:(gateway,微服务,java)