WebConfig.java
709 Bytes
package com.glsx.config;
import com.glsx.intercepter.AuthIntercepter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Autowired
AuthIntercepter authIntercepter;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(authIntercepter)
.addPathPatterns("/**")
.excludePathPatterns("/openApi/v1.0/token/**");
}
}