大家好我在node.js遇到问题,我想实现一个重定向函数,但是函数没有实现我的意思是这不是重定向到正确的页面
function(req, res, next) {
model.setDB(req.db);
var self = this;
this.authorize(req,function() {
if(self.content.userName)
{
//req.session.userName = self.content.userName;
// req.session.save();
var fullUrl= req.protocol + '://' + req.get('host') +'/userChoice';
res.redirect(fullUrl);
}
else{
var v = new View(res, 'userlogin');
v.render({title:"User login"});
}
});