事情是這樣的,我在路由里獲取用戶信息然后通過req.session.userInfo = body;進(jìn)行設(shè)置??墒菚?huì)話設(shè)置是失敗的。為何?router.get('/', function(req, res, next) { var _id = req.query.UserID; if (_id) { fetch('https://github.com/') .then(function(res) { return res.text(); }).then(function(body) { console.log(body); }); res.render('index', { title: 'Express', UserName: 'nickname' }); }});
node.js express node-fetch
慕哥9229398
2018-07-01 14:14:13