fix:修复网络请求异常时,api日志记录不完整的bug
This commit is contained in:
@@ -14,7 +14,7 @@ import javax.annotation.Resource;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Component
|
||||
public class LogApiOkHttpInterceptor implements Interceptor {
|
||||
public class OkHttpLogInterceptor implements Interceptor {
|
||||
|
||||
@Resource
|
||||
CoreLogApiMapper coreLogApiMapper;
|
||||
@@ -52,6 +52,9 @@ public class LogApiOkHttpInterceptor implements Interceptor {
|
||||
|
||||
response = new Response.Builder()
|
||||
.request(request)
|
||||
.protocol(Protocol.HTTP_1_1)
|
||||
.code(logApi.getResult())
|
||||
.message(e.getMessage())
|
||||
.body(OkHttpUtil.ofJsonResponse(logApi.getRespBody()))
|
||||
.build();
|
||||
}
|
||||
Reference in New Issue
Block a user