package com.ruoyi.framework.config;

import com.ruoyi.license.interceptor.LicenseCheckInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * packageName com.ruoyi.framework.config
 *
 * @author wangxy
 * @version JDK 8
 * @className InterceptorConfig
 * @date 2024/6/13
 * @description 拦截器配置
 */

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Resource
    private LicenseCheckInterceptor licenseCheckInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        //添加要拦截的url
        // registry.addInterceptor(licenseCheckInterceptor)
                // 拦截的路径
        //   .addPathPatterns("/login");
        // 放行的路径
//                .excludePathPatterns("/admin/login");
    }

}
