1、对被转义json字符串进行反转义
let str = '{\"productName\":\"PC电脑\",\"price\":1999,\"description\":\"无与伦比\"}';
// 方式一
let jsonObj1 = eval("(" + str + ")");
console.log(jsonObj1);
// 方式二
let jsonObj2 = JSON.parse(JSON.stringify(str).replace(/\\"/g, '"').slice(1, -1));
console.log(jsonObj2);