package com.sundot.airport.framework.config;

import com.sundot.airport.framework.interceptor.RequestSourceInterceptor;
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;

/**
 * 拦截器配置
 *
 * @author ruoyi
 */
@Configuration
public class WebAdminInterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private RequestSourceInterceptor requestSourceInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(requestSourceInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/captchaImage", "/login", "/logout", "/sms/code");
    }

}