【发布时间】:2026-01-25 02:25:02
【问题描述】:
这是我用来删除对象的restangular代码
$scope.delO = (id){
Restangular
.one("footer",id)
.get()
.then((ob)=>{
ob.remove();
}
.catch....
}
当我在浏览器中验证时,请求正在正确发送。这是快递代码
route.delete("/",(req,res,next)=>{
console.log(req.body);
helper['del'](req.body._id)
.then(()=>{
res.status(200).end();
})
.catch((err)=>{
res.status(400).json({err:err.message});
});
});
req.body 为空。根据question here我看应该在参数里面。
谁能解释一下我哪里出错了?
编辑
为了消除一些混乱,这里是浏览器的屏幕截图
【问题讨论】:
标签: javascript node.js express restangular