package org.jeecg.config;
|
|
import org.jeecg.config.license.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;
|
|
/**
|
* @Author: lius
|
* @Description: License拦截器配置
|
* @DateTime: 17:55 2024/11/2
|
*/
|
@Configuration
|
public class LicenseConfig implements WebMvcConfigurer {
|
|
@Resource
|
private LicenseCheckInterceptor licenseCheckInterceptor;
|
|
@Override
|
public void addInterceptors(InterceptorRegistry registry) {
|
|
//添加要拦截的url
|
registry.addInterceptor(licenseCheckInterceptor)
|
// 拦截的路径
|
.addPathPatterns("/**")
|
// 放行的路径
|
.excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**", "/doc.html")//swagger
|
.excludePathPatterns("/base/license/**");//生成license和获取服务器硬件信息
|
}
|
}
|