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

修改bug

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