事情是这样的,我在路由里获取用户信息然后通过req.session.userInfo = body;
进行设置。
可是会话设置是失败的。
为何?
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' });
}
});
慕桂英546537