com.lx.boot.web.LXInterceptorConfigurer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lxboot3 Show documentation
Show all versions of lxboot3 Show documentation
使用文档: https://a7fi97h1rc.feishu.cn/docx/X3LRdtLhkoXQ8hxgXDQc2CLOnEg?from=from_copylink
package com.lx.boot.web;//说明:
/**
* 创建人:游林夕/2019/5/8 17 10
*/
import com.lx.constant.DefaultBaseConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
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;
import static com.lx.constant.DefaultBaseConstant.DEFAULT_SERVER_NOTAUTHANDENCRYPTION_URLS;
@Slf4j
@Configuration
@ConditionalOnProperty(name = DefaultBaseConstant.SECURITY_INTERCEPTOR_ENABLE, havingValue = "true", matchIfMissing = true)
public class LXInterceptorConfigurer implements WebMvcConfigurer {
@Bean
public DefaultSecurityInterceptor defaultSecurityInterceptor() {
return new DefaultSecurityInterceptor();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(defaultSecurityInterceptor())
.excludePathPatterns(DEFAULT_SERVER_NOTAUTHANDENCRYPTION_URLS)
.addPathPatterns("/**");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy