29 lines
1.0 KiB
Java
29 lines
1.0 KiB
Java
package com.ruoyi.promo.config;
|
|
|
|
import com.ruoyi.promo.interceptor.PromoMaintenanceInterceptor;
|
|
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;
|
|
|
|
/**
|
|
* 推广后台 Web 配置:注册维护拦截器。
|
|
* <p>
|
|
* 对 /promo/** 生效,放行登录/注册接口(登录/注册由 PromoLoginController 自行提示维护)。
|
|
*
|
|
* @author ruoyi
|
|
*/
|
|
@Configuration
|
|
public class PromoWebConfig implements WebMvcConfigurer {
|
|
|
|
@Autowired
|
|
private PromoMaintenanceInterceptor promoMaintenanceInterceptor;
|
|
|
|
@Override
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
|
registry.addInterceptor(promoMaintenanceInterceptor)
|
|
.addPathPatterns("/promo/**")
|
|
.excludePathPatterns("/promo/login", "/promo/smsLogin", "/promo/register");
|
|
}
|
|
}
|