Nodejs-Can't set headers after they are sent
Router.get('/info',function(req,res){ console.log(req) const { userid } = req.cookies; console.log(userid) if( !userid ){ return res.json({ code : 1}) } User.findOne({_id:userid}, _filter, function(err, doc){ if(err){ return res.json({code:1, msg:'后端出错'}) } if(doc){ return res.json({code:0, data:doc}) } }) //return res.json({code:1}) })