All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lx.boot.web.LXInterceptorConfigurer Maven / Gradle / Ivy

Go to download

使用文档: https://a7fi97h1rc.feishu.cn/docx/X3LRdtLhkoXQ8hxgXDQc2CLOnEg?from=from_copylink

There is a newer version: 1.1
Show newest version
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