springcloud-gateway与spring-boot-starter-web不兼容

springcloud-gateway自带web依赖,如果引用spring-boot-starter-web会报如下错误:

springcloud-gateway与spring-boot-starter-web不兼容

 

 

 

gateway yml配置:

 

spring:
  cloud:
    gateway:
      discovery:
        locator:
          enabled: true
          lower-case-service-id: true #服务名称支持小写
      routes:
          - id: hbistc-ums
            uri: lb://hbistc-ums
            predicates:
                  - Path=/ums/**
            filters:
                  - StripPrefix=1
      globalcors:
        cors-configurations:
          '[/**]':
            allowCredentials: true #允许访问携带token
            allowedOrigins: "*"
            allowedHeaders: "*"
            allowedMethods: "*"

 

上一篇:【Spring专场】「SpringCloud」微服务网关服务的Gateway全流程开发实践指南(2.2.X)


下一篇:网关 注册中心