pull/1/head
tanghc 6 years ago
parent f123472912
commit 84b3bcbb04
  1. 4
      sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/util/OpenUtil.java

@ -37,7 +37,11 @@ public class OpenUtil {
if (StringUtils.containsAny(contentType, MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_PLAIN_VALUE)) { if (StringUtils.containsAny(contentType, MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_PLAIN_VALUE)) {
try { try {
String requestJson = IOUtils.toString(request.getInputStream(), StandardCharsets.UTF_8); String requestJson = IOUtils.toString(request.getInputStream(), StandardCharsets.UTF_8);
if (StringUtils.isBlank(requestJson)) {
jsonObject = new JSONObject();
} else {
jsonObject = JSON.parseObject(requestJson); jsonObject = JSON.parseObject(requestJson);
}
} catch (Exception e) { } catch (Exception e) {
jsonObject = new JSONObject(); jsonObject = new JSONObject();
log.error("获取文本数据流失败", e); log.error("获取文本数据流失败", e);

Loading…
Cancel
Save