// console.log(row);
//当请求成功时,则执行.then,否则执行.catch,不管什么情况都要执行是.finally
axios.delete("/book/"+row.id).then((res)=>{
if (res.data.flag){
//添加成功给与提示
this.$message.success("删除数据成功");
}else{
this.$message.error("删除数据失败");
}
}).finally(()=>{
this.getAll();
});
},
后端controller层是基于restful风格写的
@DeleteMapping("{id}")
public Uniformity delete(@PathVariable Integer id){
Boolean flag=ibookService.removeById(id);
return new Uniformity(flag);
}