大概率拦截器拦截下来了,我们F12看网络请求进行排查
都是 /webjars/ 路径下的资源被拦截了,只需在拦截器中添加该白名单即可
"/webjars/**"
具体配置如下:
@Configuration
public class WebConfig implements WebMvcConfigurer {private final LoginInterceptor loginInterceptor;public WebConfig(LoginInterceptor loginInterceptor) {this.loginInterceptor = loginInterceptor;}// 拦截器@Overridepublic void addInterceptors(InterceptorRegistry registry) {// 向拦截器注册表(InterceptorRegistry)中添加了一个拦截器 (loginInterceptor)registry.addInterceptor(loginInterceptor)// 指定接口不拦截.excludePathPatterns("/swagger-ui/**","/v3/api-docs/**","/doc.html","/webjars/**");}
}