
package com.huimv.receive.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description: 注册验证tocken的拦截器
 * @Author
 * @Date 2021/4/19 20:41
 * @Version V1.0
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Bean
    public JWTInterceptor jwtInterceptor(){
        return new JWTInterceptor();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(jwtInterceptor()).
                excludePathPatterns("/secureApi/admin/my/*","/secureApi/bill-access-door/getDoorData","/secureApi/bill-gate/getGateData")
                .excludePathPatterns("/secureApi/receive/feed","/secureApi/bill-personnel-admission/printAdmission"
                        ,"/secureApi/bill-personnel-admission/printAdmission"
                        ,"/secureApi/bill-pcr/printPcr"
                        ,"/secureApi/bill-clean/printClean"
                        ,"/secureApi/bill-isolate/printIsolate"
                        ,"/secureApi/bill-luggage/printLuggage"
                        ,"/secureApi/admin/user/printUser"
                        ,"/secureApi/accountMultilevel/printAccount"
                        ,"/secureApi/base-device/printDevice"
                        ,"/secureApi/bill-personnel-admission/listDoor"

                        //后台统计接口开放
                        ,"/secureApi/bill-personnel-admission/countAdmission"
                        ,"/secureApi/bill-personnel-admission/listTop"
                        ,"/secureApi/bill-personnel-admission/admissionTail"
                        ,"/secureApi/bill-personnel-admission/selectList"
                        ,"/secureApi/bill-personnel-admission/uploadImgAndAdmissin"
                        ,"/secureApi/bill-personnel-admission/delete"

                        ,"/secureApi/bill-pcr/pcrWhole"
                        ,"/secureApi/bill-pcr/listType"
                        ,"/secureApi/bill-pcr/listLocation"
                        ,"/secureApi/bill-pcr/listAll"
                        ,"/secureApi/bill-pcr/selectList"
                        ,"/secureApi/bill-pcr/delete"


                        ,"/secureApi/bill-clean/listCount"
                        ,"/secureApi/bill-clean/allList"
                        ,"/secureApi/bill-clean/CleanSelect"
                        ,"/secureApi/bill-clean/delete"
                        ,"/secureApi/bill-clean/listScreen"


                        ,"/secureApi/bill-isolate/isolateList"
                        ,"/secureApi/bill-isolate/isolateSelect"
                        ,"/secureApi/bill-isolate/delete"

                        ,"/secureApi/bill-luggage/listLuggage"
                        ,"/secureApi/bill-luggage/selectLuggage"
                        ,"/secureApi/bill-luggage/delete"

                        ,"/secureApi/bill-sampling/listAll"
                        ,"/secureApi/bill-clean-before/listCleanBefore"
                        ,"/secureApi/bill-goods-inventory/list"

                        ,"/secureApi//bill-sampling/getVideo"
                        ,"/secureApi/bill-personnel-admission/jingJiAdmission"
                        ,"/secureApi/bill-personnel-admission/allCount"
                        ,"/secureApi/bill-pcr/pcrList"
                        ,"/secureApi/bill-goods-inventory/listAll");
    }
}
