WebConfig.java
787 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;
/**
* @Description: 拦截器配置类
* @author fengzhi
* @version V1.0
*/
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Autowired
AuthIntercepter authIntercepter;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(authIntercepter)
.addPathPatterns("/**")
.excludePathPatterns("/openApi/v1.0/token");
}
}