axios和后端交互时,参数需要写在body和query中同时写
axios.post('/api/xxx',{ // post body },{ params: { // query } })
demo:
let params = { _id:this.alarmAddForm._id, name:this.alarmAddForm.name, userId:"user1", } this.$http.post('/geofence/api/geofence/updateElectricFence',this.pentagonpath,{params:params}).then((res)=>{ if(res.data.errcode == 0 ){ this.editVisible = false this.load() }
长风破浪会有时,直挂云帆济沧海