代码拉取完成,页面将自动刷新
springboot: 2.7.3
knife4j-gateway-spring-boot-starter: 4.4.0
...
配置service-config时,能加载出微服务的接口文档,能请求微服务接口
问题1. 配置service-config,但未配置context-path时,接口文档无法加载
问题2. 指定service-config的context-path时,能加载出微服务接口文档,但是接口的请求地址中指定的path重复
...
配置service-config,但未配置context-path时,不影响接口文档的加载和请求
配置service-config,并且配置context-path时,接口请求路径中的path不会重复
...
问题2的临时解决方案,增加如下配置:
spring:
cloud:
gateway:
x-forwarded:
# 避免 Swagger 重复带上额外的前缀
prefix-enabled: true
...