Commit d9acfbef authored by yanzg's avatar yanzg

常规BUG的修改

parent 4f03c9af
......@@ -39,6 +39,9 @@ public class WebAspect extends BaseRequestAspect {
@Value("${yzg.reqUrl:order,check,use}")
private String reqUrl;
@Value("${yzg.gateway:^.*gateway.*$}")
private String gateWay;
/**
* exec aop point aspect
*/
......@@ -59,11 +62,15 @@ public class WebAspect extends BaseRequestAspect {
Object result = null;
Exception ex = null;
Ref<Boolean> flag = new Ref<>(false);
boolean isGateWay = isGateWay();
try {
tokenServiceCall.tokenInit();
if (!isGateWay) {
tokenServiceCall.tokenInit();
}
result = executeMethod(joinPoint);
tokenFinish(flag);
if (!isGateWay) {
tokenFinish(flag);
}
return result;
} catch (Exception e) {
ex = e;
......@@ -74,12 +81,22 @@ public class WebAspect extends BaseRequestAspect {
throw e;
}
} finally {
tokenFinish(flag);
if (!isGateWay) {
tokenFinish(flag);
}
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