Commit 801e6982 authored by yanzg's avatar yanzg

Merge remote-tracking branch 'origin/master'

parents c32e0d57 1db8b2b5
...@@ -74,15 +74,19 @@ public class AspectWeb { ...@@ -74,15 +74,19 @@ public class AspectWeb {
*/ */
@Around(value = "webAspect()") @Around(value = "webAspect()")
public Object requestWebAround(ProceedingJoinPoint joinPoint) throws Throwable { public Object requestWebAround(ProceedingJoinPoint joinPoint) throws Throwable {
Class declaringType = joinPoint.getSignature().getDeclaringType();
String url = aspectLogUrl.getWebMethodUrl(joinPoint);
// 判断是否网关 // 判断是否网关
boolean isGateWay = cloudConfig.isGateWay(); boolean isGateWay = cloudConfig.isGateWay();
if (isGateWay) { if (isGateWay) {
// 网关不进行任何拦截处理 try {
return executeMethod(joinPoint); // 网关不进行任何拦截处理
return executeMethod(joinPoint);
} catch (Exception ex) {
System.err.println("请求地址错误:" + url);
throw ex;
}
} }
Class declaringType = joinPoint.getSignature().getDeclaringType();
String url = aspectLogUrl.getWebMethodUrl(joinPoint);
Object requestBody = aspectLogBody.getRequestBody(joinPoint); Object requestBody = aspectLogBody.getRequestBody(joinPoint);
boolean clear = aspectLogStart.requestLogInit(); boolean clear = aspectLogStart.requestLogInit();
LogVo log = new LogVo(); LogVo log = new LogVo();
......
...@@ -32,7 +32,12 @@ public class WebConfig extends WebMvcConfigurerAdapter { ...@@ -32,7 +32,12 @@ public class WebConfig extends WebMvcConfigurerAdapter {
@Override @Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException { throws ServletException, IOException {
filterChain.doFilter(request, response); try {
filterChain.doFilter(request, response);
} catch (Exception ex) {
System.err.println("请求地址错误:" + request.getRequestURI());
throw ex;
}
} }
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment