//json字符串是不能直接用的,需解析
data: "{"code":"200","msg":"SUCCESS","data":{"url":"\/uploads\/20191017\/1562752348843311.png"}}"
let datas = eval("("+data+")");
console.log(datas)
最后解析为为这样:
{code: "200", msg: "SUCCESS", data: {url: "/uploads/20191017/1562752348843311.png"
}}
字符串解析
最新推荐文章于 2022-11-10 16:16:07 发布