|
@@ -0,0 +1,24 @@
|
|
|
|
+package org.diagbot.push.config;
|
|
|
|
+
|
|
|
|
+import org.diagbot.bigdata.common.RegionInterceptor;
|
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
|
+import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
|
|
|
|
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
|
|
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @ClassName org.diagbot.nlp.config.InterceptorConfig
|
|
|
|
+ * @Description TODO
|
|
|
|
+ * @Author fyeman
|
|
|
|
+ * @Date 2019/1/14/014 11:10
|
|
|
|
+ * @Version 1.0
|
|
|
|
+ **/
|
|
|
|
+@Configuration
|
|
|
|
+public class InterceptorConfig implements WebMvcConfigurer {
|
|
|
|
+ @Override
|
|
|
|
+ public void addInterceptors(InterceptorRegistry registry) {
|
|
|
|
+ //登录拦截的管理器
|
|
|
|
+ InterceptorRegistration registration = registry.addInterceptor(new RegionInterceptor()); //拦截的对象会进入这个类中进行判断
|
|
|
|
+ registration.addPathPatterns("/**"); //所有路径都被拦截
|
|
|
|
+ }
|
|
|
|
+}
|