package com.liangjian.dataplatform.member.config;

import com.liangjian.dataplatform.member.interceptor.PermInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author: 黄子奇
 * @Date: 2019/10/8 17:22
 */
@Configuration
@ConditionalOnProperty(
        value = {"runOnProduct"},
        matchIfMissing = false
)
public class PermissionConfig implements WebMvcConfigurer {
    @Autowired
    private PermInterceptor permInterceptor;

    //添加拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(permInterceptor);
    }
}
