package com.estate.expert.admin.config;
|
|
import com.estate.expert.admin.interceptor.SsoSessionInterceptor;
|
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 code
|
* @Description 拦截器配置
|
* @Date 2023/2/26 11:42
|
* @Version 1.0
|
*/
|
@Configuration
|
public class InterceptorConfig implements WebMvcConfigurer {
|
|
@Autowired
|
private SsoSessionInterceptor ssoSessionInterceptor;
|
|
@Override
|
public void addInterceptors(InterceptorRegistry registry) {
|
registry.addInterceptor(ssoSessionInterceptor)
|
// 排除Swagger相关路径,允许匿名访问
|
.excludePathPatterns("/swagger-ui/**")
|
.excludePathPatterns("/webjars/**")
|
.excludePathPatterns("/v3/api-docs/**")
|
.excludePathPatterns("/swagger-resources/**")
|
// 排除公共接口路径
|
.excludePathPatterns("/public/**");
|
}
|
|
}
|