Commit 7899f85d authored by 周健威's avatar 周健威

修改bug

parent 33cceddf
package com.github.wxiaoqi.security.common.log;
import com.alibaba.fastjson.JSON;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.log.CommonLogService;
import com.github.wxiaoqi.security.common.log.entity.XxLogEntity;
import com.github.wxiaoqi.security.common.msg.BaseResponse;
......@@ -54,19 +55,17 @@ public class XxLogInterceptor{
result = pjp.proceed();//执行方法,获取返回参数
//###################下面代码为方法执行后#####################
commonLogService.initCommonLogLastPart(xxLogEntity, (BaseResponse) result);
}catch (BaseException e){
commonLogService.initCommonLogLastPart(xxLogEntity, ObjectRestResponse.createFailedResult(e.getStatus(), e.getMessage()));
}catch (Exception e){
commonLogService.initCommonLogLastPart(xxLogEntity, (BaseResponse) result);
xxLogEntity.setResponseData(JSON.toJSONString(ObjectRestResponse.createDefaultFail()));
commonLogService.initCommonLogLastPart(xxLogEntity, ObjectRestResponse.createFailedResult(500, e.getMessage()));
throw e;
}finally {
commonLogService.commonLog(xxLogEntity);
}
if(result instanceof BaseResponse) {
return (BaseResponse)result;
}else {
return result;
}
return result;
}
// @Around("within(com.github.wxiaoqi.security.security.gate.filter..*)")
......
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