package com.sunyard.chsm.config;

import com.sunyard.chsm.auth.AuthHandler;
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.WebMvcConfigurer;

/**
 * @author liulu
 * @since 2024/12/6
 */
@Configuration
public class WebConfig {


    @Bean
    public WebMvcConfigurer webMvcConfigurer(AuthHandler authHandler) {
        return new WebMvcConfigurer() {
            @Override
            public void addInterceptors(InterceptorRegistry registry) {
                registry.addInterceptor(authHandler).addPathPatterns("/**");
            }
        };
    }



}
