vue-resource获取不了数据,和ajax的区别,及vue-resource用法
1个回答
2017-07-31
展开全部
_this.$http.post('/apiwx2/xqsj.php',
{
'token' : _this.token,
'house' : _this.userName,
},
{emulateJSON : true}
).then((response) => {
let ret = (new Function("return " + response.data))();
if(ret.code == 1){
_this.showSuccess = true;
}else if(ret.code == 3){
_this.showError = true;
}else{
_this.tips(ret.msg);
}
})
.catch(function (response) {
console.log(response)
})
{
'token' : _this.token,
'house' : _this.userName,
},
{emulateJSON : true}
).then((response) => {
let ret = (new Function("return " + response.data))();
if(ret.code == 1){
_this.showSuccess = true;
}else if(ret.code == 3){
_this.showError = true;
}else{
_this.tips(ret.msg);
}
})
.catch(function (response) {
console.log(response)
})
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询