package com.yzt.airconditionersystem.config;

import com.yzt.airconditionersystem.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author TzZach
 * @since 2022-04-09 12:56
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/login", "/favicon.ico",  "/css/**", "/fonts/**", "/images/**", "/js/**", "/lib/**");
    }
}
