你在app.js中判断了如果req.session.user不为空就把user放在locals中, 应该把这个if条件去掉。这样当session中的user为空的时候, locals中的值也就随之变成空。
2015-07-18
NPM 包说明里面不建议使用这个作为Midware , 因为有tempFile ,而且不会自动清理
connect middleware for multiparty.
This middleware will create temp files on your server and never clean them up. Thus you should not add this middleware to all routes; only to the ones in which you want to accept uploads.
connect middleware for multiparty.
This middleware will create temp files on your server and never clean them up. Thus you should not add this middleware to all routes; only to the ones in which you want to accept uploads.
2015-07-18
老师老师!!
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
这样用了之后登陆会报错“TypeError: Cannot read property 'name' of undefined”
如果写成这样,就OK了
app.use(bodyParser.urlencoded({ extended: true }));
不知道你那边是不是这样子呢?
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
这样用了之后登陆会报错“TypeError: Cannot read property 'name' of undefined”
如果写成这样,就OK了
app.use(bodyParser.urlencoded({ extended: true }));
不知道你那边是不是这样子呢?
2015-07-18
已采纳回答 / 常山造纸农
我也遇到这样的问题,用extends继承的话,被继承的页面有数据,继承的页面拿不到数据,用include包含就正常。但是在资源方面,用extends,资源位置正常,但是也不会继承数据,用include包含的话,缩进对的,资源位置就变了 <...图片...>
2015-07-13