这个例子的富文本中包含了文本、视频、图片,由于出现'\'的原因导致在提交时出现如下错误:
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
解决方法:
在提交之前,对表单中的富文本字段进行采用
encodeURIComponent()方法进行处理,处理掉参数中的`\` 但是这种方法在回显时,需要对数据进行
decodeURIComponent()处理
可能还有其他方式能够解决,希望前端大佬指正告知。