| | |
| | | package com.zy.common.config; |
| | | |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.common.utils.Http; |
| | | //import com.zy.common.constant.MesConstant; |
| | | //import com.zy.common.route.RouteFilter; |
| | | //import com.zy.common.utils.Http; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | // registry.addInterceptor(new RouteFilter()) |
| | | // .addPathPatterns("/api/robot") // 拦截路径 |
| | | // .excludePathPatterns("/static/**"); // 排除静态资源 |
| | | registry.addInterceptor(adminInterceptor) |
| | | .addPathPatterns("/**") |
| | | ; |
| | | } |
| | | |
| | | // @Bean |
| | | // public RequestMappingHandlerMapping requestMappingHandlerMapping() { |
| | | // RequestMappingHandlerMapping handlerMapping = new CustomRequestMappingHandlerMapping(); |
| | | // handlerMapping.setOrder(0); |
| | | // handlerMapping.setInterceptors(new RouteFilter()); |
| | | // return handlerMapping; |
| | | // } |
| | | |
| | | @Override |
| | | public void addCorsMappings(CorsRegistry registry) { |
| | | registry.addMapping("/**") |