// WebMvc 配置：注册拦截器
package org.jeecg.config.saas;

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
    private TenantInterceptor tenantInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(tenantInterceptor).addPathPatterns("/**")
        .excludePathPatterns(
                "/swagger-resources/**",// Swagger 文档资源
                "/webjars/**",          // Swagger UI 所需静态资源
                "/v2/**",               // Swagger 接口文档 v2
                "/swagger-ui.html/**",   // Swagger UI 页面本身
                "/swagger-ui/**"
        );
    }
}
