位置:
ruoyi-admin
模块的pom.xml
文件
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
swaggerConfig
里添加一段代码:位置: 在
ruoyi-admin
模块中的web/core/config/SwaggerConfig.java
private final OpenApiExtensionResolver openApiExtensionResolver;
@Autowired
public SwaggerConfig(OpenApiExtensionResolver openApiExtensionResolver) {
this.openApiExtensionResolver = openApiExtensionResolver;
}
位置:在
ruoyi-admin
模块的application.yml
里面添加一下几行代码:
knife4j:
# 开启增强配置
enable: true
# 开启生产环境屏蔽 production: true 访问不了swagger
production: false
在浏览器输入
http://localhost:8080/doc.html#/home
即可访问knife4j
powered by kaifamiao