主题
跨域配置
参考以下配置
yaml
spring:
cloud:
gateway:
globalcors:
corsConfigurations:
'[/**]':
# 允许携带认证信息
allow-credentials: true
# 允许跨域的源(网站域名/ip),设置*为全部
allowed-origin-patterns: "*"
# 允许跨域的method, 默认为GET和OPTIONS,设置*为全部
allowed-methods: "*"
# 允许跨域请求里的head字段,设置*为全部
allowed-headers: "*"
max-age: 3600
default-filters:
- DedupeResponseHeader=Access-Control-Allow-Origin, RETAIN_UNIQUE