|
@@ -3,6 +3,7 @@ package com.free;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
|
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
|
|
import com.free.frame.AuthenticationInterceptor;
|
|
@@ -11,12 +12,21 @@ import com.free.frame.AuthenticationInterceptor;
|
|
|
public class InterceptorConfig implements WebMvcConfigurer {
|
|
|
@Override
|
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
|
|
- registry.addInterceptor(authenticationInterceptor()).excludePathPatterns("/kf/login/**", "/kf/logout")
|
|
|
- .addPathPatterns("/**");
|
|
|
+ registry.addInterceptor(authenticationInterceptor())
|
|
|
+ .addPathPatterns("/**")
|
|
|
+ .excludePathPatterns("/kf/login/**", "/kf/logout", "/swagger**/**", "/webjars/**", "/v3/**", "/doc.html");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
|
+
|
|
|
+ registry.addResourceHandler("/swagger-ui/**")
|
|
|
+ .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/");
|
|
|
}
|
|
|
|
|
|
@Bean
|
|
|
public AuthenticationInterceptor authenticationInterceptor() {
|
|
|
return new AuthenticationInterceptor();
|
|
|
}
|
|
|
+
|
|
|
}
|