Commit d9acfbef authored by yanzg's avatar yanzg

常规BUG的修改

parent 4f03c9af
...@@ -39,6 +39,9 @@ public class WebAspect extends BaseRequestAspect { ...@@ -39,6 +39,9 @@ public class WebAspect extends BaseRequestAspect {
@Value("${yzg.reqUrl:order,check,use}") @Value("${yzg.reqUrl:order,check,use}")
private String reqUrl; private String reqUrl;
@Value("${yzg.gateway:^.*gateway.*$}")
private String gateWay;
/** /**
* exec aop point aspect * exec aop point aspect
*/ */
...@@ -59,11 +62,15 @@ public class WebAspect extends BaseRequestAspect { ...@@ -59,11 +62,15 @@ public class WebAspect extends BaseRequestAspect {
Object result = null; Object result = null;
Exception ex = null; Exception ex = null;
Ref<Boolean> flag = new Ref<>(false); Ref<Boolean> flag = new Ref<>(false);
boolean isGateWay = isGateWay();
try { try {
tokenServiceCall.tokenInit(); if (!isGateWay) {
tokenServiceCall.tokenInit();
}
result = executeMethod(joinPoint); result = executeMethod(joinPoint);
tokenFinish(flag); if (!isGateWay) {
tokenFinish(flag);
}
return result; return result;
} catch (Exception e) { } catch (Exception e) {
ex = e; ex = e;
...@@ -74,12 +81,22 @@ public class WebAspect extends BaseRequestAspect { ...@@ -74,12 +81,22 @@ public class WebAspect extends BaseRequestAspect {
throw e; throw e;
} }
} finally { } finally {
tokenFinish(flag); if (!isGateWay) {
tokenFinish(flag);
}
responseLog(TAG, HttpAspectUtil.getHttpRequestUrl(), joinPoint, start, result, ex); responseLog(TAG, HttpAspectUtil.getHttpRequestUrl(), joinPoint, start, result, ex);
} }
} }
/**
* 是否属于网关服务,网关服务不进行监控
*
* @return
*/
private boolean isGateWay() {
return this.applicationName.matches(this.gateWay);
}
/** /**
* 执行结束函数 * 执行结束函数
* *
......
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