swagger版本:3.0.0
依赖:
io.springfox springfox-boot-starter 3.0.0
报错界面:
我看了网上很多人的,但是没有一个能解决我的情况
最后解决的配置是这样的:
package top.sehnsucht.common.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.*;
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Autowired
@Qualifier(value = "loginInterceptor")
private HandlerInterceptor handlerInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
InterceptorRegistration registration = registry.addInterceptor(handlerInterceptor);
//拦截路径
registration.addPathPatterns("**"
,"/webjars**和/v2/**
参考:
https://blog.csdn.net/xyh930929/article/details/109537258
https://blog.csdn.net/Ju3tinZz/article/details/115762426
https://blog.xujiuming.com/ming/14d110a5.html



