mirror of
https://github.com/RemainderTime/spring-boot-base-demo.git
synced 2026-02-21 06:20:57 +08:00
降低springboot版本为2.4.6,为了更好兼容其他框架。
整合knife4j生成接口文档
This commit is contained in:
23
src/main/java/cn/xf/basedemo/config/WebMvcConfig.java
Normal file
23
src/main/java/cn/xf/basedemo/config/WebMvcConfig.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package cn.xf.basedemo.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||
|
||||
/**
|
||||
* @program: xf-boot-base
|
||||
* @ClassName WebMvcConfig
|
||||
* @description: 放行Knife4j请求
|
||||
* @author: xiongfeng
|
||||
* @create: 2022-07-26 11:17
|
||||
**/
|
||||
@Configuration
|
||||
public class WebMvcConfig extends WebMvcConfigurationSupport {
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
|
||||
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user