vue-resource获取不了数据,和ajax的区别,及vue-resource用法

2024-11-18 16:27:26
推荐回答(1个)
回答1:

vue-resource获取不了数据,和ajax的区别,及vue-resource用法
_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)
})