使用vue-resource請(qǐng)求json文件時(shí),使用get方法是可以獲取到的this.$http.get('./static/json/banner.json')
.then((response) => { console.log(response.data);
}).catch((response) => { console.log(response);
});但是使用post就報(bào)404錯(cuò)誤了this.$http.post('./static/json/banner.json', {})
.then((response) => { console.log(response.data);
}).catch((response) => { console.log(response);
});修改過emulateJSON屬性與emulateHTTP屬性將路徑改成http://localhost:8080/static/...過給實(shí)例修改過headers屬性查了很久了,試了很多方法都無效,請(qǐng)問是什么問題??
vue-resource中使用post方法請(qǐng)求json報(bào)404錯(cuò)誤
慕田峪4524236
2018-10-19 11:10:10