package com.zzsn.knowbase.config.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description:
 * @Author: obcy
 * @Date: 2024/4/5
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 添加自定义拦截器，拦截所有路径
        registry.addInterceptor(new KnowInterceptor()).addPathPatterns("/**");
    }
}
