package com.winsun.item.modular.config;


import com.winsun.item.modular.intercept.ChangePwdInterceptor;
import com.winsun.item.modular.intercept.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;


/**
 * @Author xuede
 * @Date 2020/2/29 16:11
 * @Version 1.0
 */
@Configuration
public class LoginApplicaionConfig extends WebMvcConfigurationSupport {

    @Autowired
    private LoginInterceptor loginInterceptor;

    @Autowired
    private ChangePwdInterceptor changePwdInterceptor;



    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        // login changePwd路径进行拦截
        registry.addInterceptor(loginInterceptor).addPathPatterns("/login");
        registry.addInterceptor(changePwdInterceptor).addPathPatterns("/mgr/changePwd");
        super.addInterceptors(registry);
    }

}
