From 10d770c0cfc0b096f0d105c956a6fe6adebade09 Mon Sep 17 00:00:00 2001 From: lihongjie0209 Date: Sat, 12 Aug 2023 14:55:31 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E5=A4=84=E7=90=86=E4=BA=8C=E8=BF=9B?= =?UTF-8?q?=E5=88=B6=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lihongjie/coal/config/RResponseBodyAdvice.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/cn/lihongjie/coal/config/RResponseBodyAdvice.java b/src/main/java/cn/lihongjie/coal/config/RResponseBodyAdvice.java index 50c18750..a11d0960 100644 --- a/src/main/java/cn/lihongjie/coal/config/RResponseBodyAdvice.java +++ b/src/main/java/cn/lihongjie/coal/config/RResponseBodyAdvice.java @@ -7,7 +7,6 @@ import org.springframework.http.MediaType; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.server.ServerHttpRequest; import org.springframework.http.server.ServerHttpResponse; -import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; @@ -30,7 +29,9 @@ public class RResponseBodyAdvice implements ResponseBodyAdvice { if (!selectedContentType.includes(MediaType.APPLICATION_JSON)) { return body; } - + if (body instanceof byte[]) { + return body; + } if (body instanceof R) { return body;