var app = new Vue({
el: '#app',
data: {
item: {
access_token: '3a7a3c4c2cdcaf9e83b887140189d352',
brand_id: 1,
venue_id: 1,
emp_id: 1
}
},
methods: {
getCoachInfo: function() {
var self = this;
this.$http.post('//121.42.41.228:8011/employee/api/wxcempdetail', this.item).then(
function(res) {
if (res.error == 'ok') {
self.name = res.data.name;
} else {
alert('error');
}
});
}
}
});
调试工具已经显示向接口传递的参数了,如截图:
但是接口返回的结果是“信息不完整”:
应该不是接口的问题,因为我用jQuery的$.post请求成功了,就是“this.item”传递参数这里出了问题,请大神赐教~
请求前加上这段试试