loadData() {
this.$http.get('.php',{params: {id: 1}})
.then(({data: {data, errcode, msg}}) => {
if (errcode === 0) {
} else {
$.toast(msg, 'forbidden') // 报错信息
// console.error("获取失败:" + msg);
}
}, (response) => {
// error callback
// console.log(response)
})
}
loadData() {
let params = {id:1}
this.$http.post('.php',params)
.then(({data: {data, errcode, msg}}) => {
if (errcode === 0) {
} else {
$.toast(msg, 'forbidden') // 报错信息
// console.error("获取失败:" + msg);
}
}, (response) => {
// error callback
// console.log(response)
})
}
请求get和post
最新推荐文章于 2022-05-27 03:47:27 发布