vue开发:axios的post请求接口出现404,但是get则成功

methods:{
myclick(){
this.$http({
methods:"post",
url:"../../../static/my.json",
headers:{"Content-Type":'application/x-www-form-urlencoded; charset=UTF-8'}
}).then((res)=>{
console.log(JSON.stringify(res.data).length);

if(JSON.stringify(res.data).length>0){
this.myshow=false;
}else{
this.myshow=true;
}
})
}
}

猜你喜欢

转载自blog.csdn.net/Generon/article/details/78292005