1.params传参,这里post后台会接收不到
updateStatus:function (id,status) {
var _this = this;
axios.get("/seller/updateStatus.do",{params:{id:id,status:status}}).then(function (response) {
alert(response.data.msg);
if(response.data.success)
_this.pageHandler(1);
}).catch(function (reason) {
console.log(reason);
});
},
2.传递数组
axios.post("/brand/deleteBrand.do", Qs.stringify({deleteId: this.brandSelected}, {indices: false})
).then(function (response) {
alert(response.data.msg);
if (response.data.success) {
_this.pageHandler(1);
}
}).catch(function (reason) {
console.log(reason);
});
3.传递对象,注意后台接受的是一个json格式必须requestBody转下
axios.post(url, this.brand).then(function (response) {
alert(response.data.msg);
if (response.data.success) {
_this.pageHandler(1);
}
}).catch(function (reason) {
console.log(reason);
});