首先检查springboot的版本与swagger2 swagger-ui的版本
以下是我springboot的版本
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.12</version>
</parent>
swagger2和swagger-ui的版本
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
解决方法就是不要使用 3.0.0版本,如果你选择2.9.2版本的话
还是需要跟其他博主写的一样在配置文件中添加以下代码
spring.mvc.pathmatch.matching-strategy = ant_path_matcher
我的没有编写webmvc相关配置,因为我的还没有编写登录相关的功能
以上,交流批评!!!!
版权声明:本文为weixin_45314023原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。