bugfix: 处理二进制数据

This commit is contained in:
2023-08-12 14:55:31 +08:00
parent 8cc0b3fdeb
commit 10d770c0cf

View File

@@ -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<Object> {
if (!selectedContentType.includes(MediaType.APPLICATION_JSON)) {
return body;
}
if (body instanceof byte[]) {
return body;
}
if (body instanceof R<?>) {
return body;