添加栏截器
package com.ruoyi.framework.config;
import com.ruoyi.framework.interceptor.apiInterceptor;
import com.ruoyi.framework.interceptor.jimuInterceptor;
import lombok.AllArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
* 积木报表拦截器
* 只有登录的用户才可以访问,不可匿名访问
* @author liuhuan
* @title: InterceptorConfig
* @description: TODO
* @projectName ruoyi
* @date 2021/6/239:24 上午
* @return V1.0.0
*/
@Configuration
@AllArgsConstructor
public class InterceptorConfig extends WebMvcConfigurerAdapter {
private jimuInterceptor jimuInterceptor;
private apiInterceptor apiInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(jimuInterceptor).addPathPatterns("/jmreport/view/**");
registry.addInterceptor(jimuInterceptor).addPathPatterns("/jmreport/list/**");
registry.addInterceptor(jimuInterceptor).addPathPatterns("/jmreport/index/**");
// registry.addInterceptor(apiInterceptor).addPathPatterns ("/api/**");
}
}
原创2022/7/23大约 3 分钟