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