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); }


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM