上传图片,在页面显示遇到的问题


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("\"", "'");
把数据里的”替换成’。

上一篇:wasm-pack 编译错误 unexpected character '\u{0}'


下一篇:warning Delete `␍` prettier/prettier