提交 dab1be1f authored 作者: zjm's avatar zjm

Merge branch 'dev' of git.yfzx.zjtys.com.cn:matrix/device-back into feature-check

...@@ -43,17 +43,17 @@ public class UnifiedReturnConfig implements ResponseBodyAdvice<Object> { ...@@ -43,17 +43,17 @@ public class UnifiedReturnConfig implements ResponseBodyAdvice<Object> {
return body; return body;
} }
ResultObj<Object> result = new ResultObj<>(body, "成功 :)"); ResultObj<Object> result = new ResultObj<>(body, "成功");
// 如果返回的是字符串,则要对其做JSON序列化 // 如果返回的是字符串,则要对其做JSON序列化
if (body.getClass().equals(String.class)) { // if (body.getClass().equals(String.class)) {
try { // try {
response.getHeaders().set("Content-Type", "application/json;charset=utf-8"); // response.getHeaders().set("Content-Type", "application/json;charset=utf-8");
return objectMapper.writeValueAsString(result); // return objectMapper.writeValueAsString(result);
} catch (JsonProcessingException e) { // } catch (JsonProcessingException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
} // }
// 其他的类型直接封装返回 // 其他的类型直接封装返回
return result; return result;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论