Browse Source

跨域

master
zhizhi wu 5 years ago
parent
commit
e897932e8f
  1. 16
      src/main/resources/application-dev.yml

16
src/main/resources/application-dev.yml

@ -29,6 +29,22 @@ spring:
name: gateway
cloud:
gateway:
globalcors:
cors-configurations:
'[/**]':
# 允许携带认证信息
# 允许跨域的源(网站域名/ip),设置*为全部
# 允许跨域请求里的head字段,设置*为全部
# 允许跨域的method, 默认为GET和OPTIONS,设置*为全部
# 跨域允许的有效期
allow-credentials: true
allowed-origins: "*"
allowed-headers: "*"
allowed-methods:
- OPTIONS
- GET
- POST
max-age: 3600
routes:
- id: ht-service
uri: lb://ht

Loading…
Cancel
Save