package com.ltkj.framework.config; //import com.ltkj.framework.interceptor.DBChangeInterceptor; import com.ltkj.framework.interceptor.DBChangeInterceptor; import com.ltkj.framework.interceptor.JimuInterceptor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** * @Author: 西安路泰科技有限公司/赵佳豪 * @Date: 2022/11/17 10:35 */ //定义拦截器 @Configuration public class WebConfig implements WebMvcConfigurer { @Autowired private DBChangeInterceptor dbChangeInterceptor; @Autowired private JimuInterceptor jimuInterceptor; @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new TokenInterceptor()) .addPathPatterns("/cus/**") .excludePathPatterns(new String[]{ "/cus/wx/login","/cus/order/pay-notify", "/cus/banner/getBannerList", "/cus/package/getPackageList", "/cus/package/projectListByPacId/**", "/cus/hospital/getHospList", "/lis/**","/api/His/**","/pacs/**", "/callBack/**", "/api/viewReport", "/api/reportData", "/api/getInfo" }); registry.addInterceptor(dbChangeInterceptor) .addPathPatterns("/**") .excludePathPatterns(new String[]{ "/cus/hospital/getHospList", "/cus/wx/login", "/cus/banner/getBannerList", "/system/dict/data/**", "/system/dict/type/**", "/captchaImage","/getCaptchaConfigKey/**", "/system/role/execUpdateSql", "/jmreport/**", "/**/*.html", "/**/*.css", "/**/*.js","/swagger-ui.html", "/swagger-resources/**", "/*/api-docs", "/webjars/**" }); registry.addInterceptor(jimuInterceptor) .addPathPatterns("/jmreport/**"); } }