上传图片,在页面显示遇到的问题
作者:互联网
JSON parse error: Unexpected character ('\' (code 92)): was expecting comma to separate Object entries; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('\' (code 92)): was expecting comma to separate Object entries at [Source: (PushbackInputStream); line: 1, column: 135]
因为JSON字符串带"",而携带的数据前缀是这种"<p><img src=\"data:,所以和JSON里的“冲突”,解决办法:
data.newsContent = data.newsContent.replace("\"", "'");
把数据里的”替换成’。
标签:code,页面,character,Object,JSON,comma,newsContent,上传,图片 来源: https://www.cnblogs.com/xzwdx/p/15182007.html