app.post(' /管理/编辑/:ID',上传功能(REQ,RES) {
if (req.file === undefined){
req.body.image ='/uploads/' + req.file.no-image.png;
}
else{
req.body.image = '/uploads/' + req.file.filename;
}
var id = req.params.id; Addbook.findOneAndUpdate({_ ID:ID},req.body,函数(ERR){
if(err){
return err;
}
res.redirect('/manage/book-details')
` }); });