package com.ccqq.blog.interceptor; 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.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import java.util.ArrayList; import java.util.List; @Configuration public class MyMvcConfig implements WebMvcConfigurer { @Autowired LoginInterceptor loginInterceptor; public void addViewController(ViewControllerRegistry registry){ // super.addViewControllers(registry);视图映射 //浏览器发送 /atguigu 请求来到 success registry.addViewController("/zhuce").setViewName("/doLogin"); } //注册一个拦截器 public void addInterceptors(InterceptorRegistry registry){ List list = new ArrayList(); list.add("/index"); list.add("/zhuce"); list.add("/doLogin"); list.add("/register"); list.add("/doRegist"); registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**").excludePathPatterns(list); } }
最近下载更多
2413123 LV1
昨天
张钱平 LV1
前天
微信网友_6921446303207424 LV1
3月24日
万松昊 LV1
3月17日
微信网友_6903166654566400 LV1
3月11日
736101636 LV19
3月3日
zzh718 LV1
3月1日
Rewcall LV1
2月20日
abashd LV1
2月6日
Tanghz LV1
1月12日
最近浏览更多
2413123 LV1
昨天
张钱平 LV1
前天
微信网友_6921446303207424 LV1
3月24日
周青松 LV3
3月18日
万松昊 LV1
3月17日
q111222333
3月13日
暂无贡献等级
微信网友_6903166654566400 LV1
3月11日
iamnangua
3月11日
暂无贡献等级
songsmm LV1
3月11日
暂无贡献等级