axios delete 传数组,后台spring boot
改了两小时....最后发现是自己脑子卡了,按postman那样传参就行了
前端axios
axios.delete('http://127.0.0.1:8080/cfg1', {data:this.selected}).then(res => {
this.getData(1)
}, error => {
console.log(error.response)
}).catch(function (error) {
console.log(error)
})
后台
@DeleteMapping(value = "/alarmCfg1")
public boolean delete(@RequestBody List<Integer> ids){
return alarmcfgtableService.removeByIds(ids); }