Commit 7b602b97 authored by yanzg's avatar yanzg

异常处理显示

parent 09b61120
......@@ -68,12 +68,10 @@ public class WebAspect extends BaseRequestAspect {
// 用户数据库记录
long start = requestLog(TAG, joinPoint);
Exception ex = null;
Ref<Boolean> flag = new Ref<>(false);
boolean isInit = false;
try {
isInit = tokenServiceCall.tokenInit();
result = executeMethod(joinPoint);
tokenFinish(flag);
return result;
} catch (Exception e) {
ex = e;
......@@ -84,8 +82,8 @@ public class WebAspect extends BaseRequestAspect {
throw e;
}
} finally {
tokenServiceCall.tokenFinish();
if (isInit) {
tokenFinish(flag);
TokenHelper.remove();
}
responseLog(logWeb, clear, TAG, HttpAspectUtil.getHttpRequestUrl(), joinPoint, start, result, ex);
......@@ -101,19 +99,6 @@ public class WebAspect extends BaseRequestAspect {
return this.applicationName.matches(this.gateWay);
}
/**
* 执行结束函数
*
* @param flag 结束函数
* @return 结束函数
*/
private void tokenFinish(Ref<Boolean> flag) {
if (flag.value == true) {
return;
}
flag.value = true;
tokenServiceCall.tokenFinish();
}
/**
* 获取返回的至类型
......
......@@ -52,15 +52,14 @@ public class TokenServiceCall implements TokenLoad {
*/
public boolean tokenInit() {
init();
addHave();
if (tokenService == null) {
return false;
}
if (addHave(0) == 1) {
return false;
if (addHave() == 1) {
tokenService.tokenInit();
return true;
}
tokenService.tokenInit();
return true;
return false;
}
/**
......@@ -68,11 +67,10 @@ public class TokenServiceCall implements TokenLoad {
*/
public void tokenFinish() {
init();
subHave();
if (tokenService == null) {
return;
}
if (addHave(0) == 0) {
if (subHave() == 0) {
tokenService.tokenFinish();
}
}
......
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