添加拦截器 便于测试

This commit is contained in:
zxb 2023-08-07 15:43:56 +08:00
parent ab6192a106
commit 6709c951ed
2 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ import javax.servlet.http.HttpServletResponse;
public class RequestInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
log.info("访问 {}",request.getRequestURI());
log.info("{} 访问 {}",request.getRemoteHost(), request.getRequestURI());
return true;
}
}

View File

@ -15,7 +15,7 @@ public class WebConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(@NotNull InterceptorRegistry registry) {
registry.addInterceptor(requestInterceptor)
.excludePathPatterns("/index/hook/**")
.excludePathPatterns("/index/hook/**","/static/**")
.addPathPatterns("/**");
}
}