出于某些原因,在我的jade文件中,我可以访问使用_locals设置的文件而不是本地文件?:
app.use(function (req, res, next) {
if(req.isAuthenticated()) //true
{
res.locals.user = req.user;
}else {
res.locals.user = null;
}
}
玉
-console.info(_locals.user); //{_id: 5775.....4343}
-console.info(locals.user); //undefined
-console.info(user); //null