spring: gateway: routes: - id: admin_route uri: lb://renren-fast predicates: - Path=/api/** filters: - RewritePath=/api/?(?<segment>.*), /renren-fast/$\{segment} #以下为 跨域配置 default-filters: - DedupeResponseHeader=Access-Control-Allow-Origin, RETAIN_UNIQUE globalcors: cors-configurations: '[/**]': allow-credentials: true # 允许携带认证信息 allowedOrigins: "*" # 允许跨域的源(网站域名/ip),设置*为全部 allowedMethods: "*" # 允许跨域的method, 默认为GET和OPTIONS,设置*为全部 allowedHeaders: "*" # 允许跨域请求里的head字段,设置*为全部
解决springcloud的跨域问题
最新推荐文章于 2024-09-25 16:41:10 发布