zhaowenxuan
2025-02-19 331d513f2546feb17834c89ac40513b93cdfc514
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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"
                });
 
        registry.addInterceptor(dbChangeInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns(new String[]{
                        "/system/dict/data/**",
                        "/system/dict/type/**",
                        "/captchaImage","/getCaptchaConfigKey/**",
                        "/system/role/execUpdateSql",
                        "/jmreport/**"
//                        ,
//                        "/login", "/register", "/captchaImage","/cus/**","/getCaptchaConfigKey","/report/jmreport/**",
//                        "/sqlserver/getdata/**","/api/His/**","/system/config/zx","/system/config/gxxmpym","/system/report/savePdf",
//                        "/system/dyjl/saveGjddyjl","/system/dyjl/saveBlGjddyjl","/check/ceshi","/check/pacs","/check/ceshicc",
//                        "/common/uploadImgExe","/common/listExeVal","/pacs/InvokeRisService/**","/check/dataSynchronizationApi",
//                        String.valueOf(HttpMethod.GET), "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**",
//                        "/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**","/jmreport/**","/lis/**","/pacs/**","/callBack/**"
                });
 
        registry.addInterceptor(jimuInterceptor)
                .addPathPatterns("/jmreport/**");
    }
}