首页>代码>spring boot+mybatis开发海底捞的排队系统(简易版)>/hdl/src/main/java/vip/waitfor/hdl/configurer/WebAppConfigurer.java
package vip.waitfor.hdl.configurer;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import vip.waitfor.hdl.interceptor.LoginInterceptor;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class WebAppConfigurer implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        // 白名单
        List<String> excludePathPatterns = new ArrayList<>();
        excludePathPatterns.add("/user/login");
        excludePathPatterns.add("/web/admin-login.html");
        excludePathPatterns.add("/web/hdl.html");

        // 黑名单
        List<String> PathPatterns = new ArrayList<>();
        PathPatterns.add("/user/**");
        PathPatterns.add("/web/**");

        // 注册
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns(PathPatterns)
                .excludePathPatterns(excludePathPatterns);
    }

}
最近下载更多
autonomy  LV1 4月12日
kkkllll  LV2 1月24日
hbj1285984841  LV4 2023年10月19日
iceboard  LV2 2023年6月4日
万紫怡  LV4 2023年5月15日
youzitao  LV11 2023年4月17日
朱朱啊哈  LV16 2023年1月31日
LukeMaster  LV1 2022年11月19日
crosa_Don  LV18 2022年10月7日
cmbzyjw  LV3 2022年8月17日
最近浏览更多
autonomy  LV1 4月12日
WBelong  LV7 3月29日
暂无贡献等级
kkkllll  LV2 1月24日
xshxxm1  LV21 1月23日
kaye7549317 1月16日
暂无贡献等级
fff2003  LV6 2023年12月19日
微信网友_6200582435409920 2023年12月11日
暂无贡献等级
廖业贵  LV18 2023年11月16日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友