如果谁帮忙解决,我会给他100元,虽然不多,但是体现出我想解决它的决心!!!
下面是spring gateway配置
spring:
cloud:
loadbalancer.ribbon.enabled: false
gateway:
globalcors:
#add-to-simple-url-handler-mapping: true
cors-configurations:
'[/**]':
allowedHeaders: "*"
# 为true时allowedOrigins不允许为* 会报错
allowCredentials: true
allowedOrigins:
- "https://xxx.com"
- "http://127.0.0.1:3000"
- "http://localhost:3000"
allowedMethods: "*"
default-filters:
- DedupeResponseHeader=Access-Control-Allow-Origin Access-Control-Allow-Credentials
- 697
广东1、前端请求结合withCredentials配置
2、检查下cookie的Secure设置,需要为false才能非https传送
3、当设置 SameSite=none 时,跨域请求才会携带 cookie