swagger访问地址
http://localhost:8082/swagger-ui/index.html#/
ruoyi-vue 升级到knife4j
访问地址,http://localhost:8082/doc.html#/home
1.引入依赖
1.1在父项目 pom.xml 引入依赖
<!-- Knife4j 增强Swagger文档 -->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>2.0.8</version>
</dependency>
1.2 ruoyi-admin引入依赖
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
</dependency>
2.修改配置
2.1配置类添加注解
@EnableSwagger2
@EnableKnife4j
2.2去除swagger项目路径
// 去除swagger项目路径
//.pathMapping(pathMapping);
3.添加白名单放行
SecurityConfig.java添加白名单路径
.antMatchers("*/doc.html").anonymous()