Spring Cloud Gateway CORS 跨域方案

作者 : admin 本文共269个字,预计阅读时间需要1分钟 发布时间: 2024-06-10 共2人阅读

 通过配置文件,以下配置就是其中一种方案。

    gateway: 
#跨域配置
      globalcors: 
        cors-configurations: 
          '[/**]': 
            allowedMethods: "*"
            allowedHeaders: "*"
            allowedOriginPatterns: "*"
            allowCredentials: true
      default-filters: 
        - DedupeResponseHeader=Vary Access-Control-Allow-Origin Access-Control-Allow-Credentials, RETAIN_FIRST

本站无任何商业行为
个人在线分享 » Spring Cloud Gateway CORS 跨域方案
E-->