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); }
posted @ 2020-03-08 21:58  地表最强队队员  阅读(1238)  评论(0编辑  收藏  举报