jade代码node代码路由app.post('/admin/movie/new',function(req,res){ var id = req.body.id; var movieObj = req.body; var _movie = ""; if (id != "undefined") { console.log("if"); Movie.findById(id,function(err,movie){ if (err) { console.log(err); } _movie = _.extend(movie,movieObj); _movie.save(function(err,movie){ if (err) { console.log(err); } res.redirect('/movie/' + movie._id); }) }) }else { console.log("else"); _movie = new Movie({ doctor:movieObj.doctor, title:movieObj.title, country:movieObj.country, year:movieObj.year, poster:movieObj.poster, summary:movieObj.summary, flash:movieObj.flash, language:movieObj.language }) console.log(_movie); _movie.save(function(err,movie){ if (err) { console.log(err); } res.redirect('/movie/' + movie._id); }) }})请求的状态这是为什么呢
目前暂无任何回答
- 0 回答
- 0 关注
- 1488 浏览
添加回答
举报
0/150
提交
取消