好好,非常有興趣聽您的下一個(gè)計(jì)劃:用nodejs做wechat的后臺(tái), 大約の時(shí)間 期待。。。。。
2015-07-19
你在app.js中判斷了如果req.session.user不為空就把user放在locals中, 應(yīng)該把這個(gè)if條件去掉。這樣當(dāng)session中的user為空的時(shí)候, locals中的值也就隨之變成空。
2015-07-18
NPM 包說(shuō)明里面不建議使用這個(gè)作為Midware , 因?yàn)橛衪empFile ,而且不會(huì)自動(dòng)清理
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());
這樣用了之后登陸會(huì)報(bào)錯(cuò)“TypeError: Cannot read property 'name' of undefined”
如果寫成這樣,就OK了
app.use(bodyParser.urlencoded({ extended: true }));
不知道你那邊是不是這樣子呢?
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
這樣用了之后登陸會(huì)報(bào)錯(cuò)“TypeError: Cannot read property 'name' of undefined”
如果寫成這樣,就OK了
app.use(bodyParser.urlencoded({ extended: true }));
不知道你那邊是不是這樣子呢?
2015-07-18