修复ResponseMessage.onlyData 为string的时候,被转为json的问题

This commit is contained in:
zhouhao
2016-08-17 14:17:48 +08:00
parent 9372283e85
commit 60311efb6d

View File

@@ -87,7 +87,10 @@ public class FastJsonHttpMessageConverter extends AbstractHttpMessageConverter<O
ResponseMessage message = (ResponseMessage) obj;
if (message.isSuccess() && message.isOnlyData())
obj = message.getData();
text = JSON.toJSONString(obj, parseFilter(message), features);
if (obj instanceof String)
text = ((String) obj);
else
text = JSON.toJSONString(obj, parseFilter(message), features);
if (callback == null) callback = message.getCallback();
} else {
text = JSON.toJSONString(obj, features);