JsonConvert After parsing a value an unexpected character was encountered

JsonConvert.DeserializeObject<T>(data);

报错:After parsing a value an unexpected character was encountered

错误原因是没有进行json转义

错误用法:return Json<T>(t); 输出未转义json

正确用法:return Json(JsonConvert.SerializeObject(t)); 输出转义后json

JsonConvert After parsing a value an unexpected character was encountered

上一篇:mongodb创建用户创建库分配权限


下一篇:VUE - WebStorm自带格式化和ESLint冲突的解决方法!