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.st
·
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;
}
})
}
}
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;
}
})
}
}
更多推荐
已为社区贡献15条内容
所有评论(0)