From 28b60220f30a49cbd1d9dfa394b34e7971d62f78 Mon Sep 17 00:00:00 2001 From: wangfs <15029758498@163.com> Date: Tue, 31 Jul 2018 10:13:02 +0800 Subject: [PATCH] 提交 --- src/main/java/com/zteits/oa/configuration/WebMvcConfig.java | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zteits/oa/configuration/WebMvcConfig.java b/src/main/java/com/zteits/oa/configuration/WebMvcConfig.java index aeec27e..d339220 100644 --- a/src/main/java/com/zteits/oa/configuration/WebMvcConfig.java +++ b/src/main/java/com/zteits/oa/configuration/WebMvcConfig.java @@ -2,6 +2,8 @@ package com.zteits.oa.configuration; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import org.springframework.web.servlet.config.annotation.InterceptorRegistration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @@ -12,12 +14,29 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/"); - registry.addResourceHandler("swagger-ui.html") .addResourceLocations("classpath:/META-INF/resources/"); - registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/"); - } + } + + /** + * 实现登陆拦截.
+ */ + @Override + public void addInterceptors(InterceptorRegistry registry) { + InterceptorRegistration addInterceptor = null;//registry.addInterceptor(); + + addInterceptor.excludePathPatterns("/error"); + + addInterceptor.excludePathPatterns("/login**"); + + addInterceptor.addPathPatterns("/**"); + + + + } + + } -- libgit2 0.21.4