vue-resource实现Ajax获取信息数据时, ajax请求错误返回status 0是什么问题,url没有问题,http.jsonp请求的
来源:6-4 使用 axios 发送数据请求

往事如风_forever
2017-08-31
getdata: function () {
var vm = this;
this.$http.jsonp('http://172.26.4.31:8080/project/info',{params:{page:1}})
.then(function(res){
var dates = JSON.parse(response.res)
vm.focusList = res.data;
console.log(res.data)
},function(err){
console.log(err)
console.log(123)
})
}
1回答
-
fishenal
2017-09-05
这种情况我没遇到过,status 0 可能还是跨域问题,简单搜了一下
https://stackoverflow.com/questions/38730918/vue-resource-and-jsonp-working-example
options里加以下jsonp字段试试,
还有我看文档里有个emulateJSON这个字段,可以改一下试试
搜出来的问题你可以参考一下:
https://stackoverflow.com/questions/14860877/jquery-ajax-call-getting-status-code-0-error
012017-09-07
相似问题