[图片] 打印res结果是这样的。 {statusCode: 200, data: "{"data":{"info":{"picurl":"http://img.ren111.com/…159581758033700.jpg"}},"errcode":0,"errmsg":"成功"}", header: {…}, cookies: Array(1), errMsg: "uploadFile:ok"}cookies: ["PHPSESSID=9alr7kdod0hhipfgd7kt9uhnh5; path=/"]data: "{"data":{"info":{"picurl":"http://img.ren111.com/cover_img/202007/27/159581758033700.jpg","name":"159581758033700.jpg"}},"errcode":0,"errmsg":"成功"}"errMsg: "uploadFile:ok"header: {Cache-Control: "no-store, no-cache, must-revalidate, post-check=0, pre-check=0", Pragma: "no-cache", Content-Type: "application/json", Expires: "Thu, 19 Nov 1981 08:52:00 GMT", Server: "Microsoft-IIS/8.5", …}statusCode: 200__proto__: Object
图片上传成功后,返回的json问题?[图片] {"data":{"info":{"picurl":"http://img.ren111.com/cover_img/202007/27/159581669917921.jpg","name":"159581669917921.jpg"}},"errcode":0,"errmsg":"成功"} 返回的json字符串是没问题的,但用var json = JSON.parse(res.data); 去转化的时候提示错误 Unexpected token in JSON at position 0 怎么解决这个问题?同样的代码在本地电脑上运行没问题,上传到服务器后就出现上面的问题了。
2020-07-27