Spring Cloud Gateway CORS 跨域方案
通过配置文件,以下配置就是其中一种方案。
gateway:
#跨域配置
globalcors:
cors-configurations:
'[/**]':
allowedMethods: "*"
allowedHeaders: "*"
allowedOriginPatterns: "*"
allowCredentials: true
default-filters:
- DedupeResponseHeader=Vary Access-Control-Allow-Origin Access-Control-Allow-Credentials, RETAIN_FIRST