二期项目,我增加了一些美化,用gulp打包测试等其他功能,欢迎访问star。https://github.com/legolas007/DoubanMovie2.0
2017-11-10
logout无效的可以在route.js里这样修改
app.use(function (req, res, next) {
var _user = req.session.user
if (_user) {
app.locals.user = _user
} else {
delete app.locals.user
}
next()
})
app.use(function (req, res, next) {
var _user = req.session.user
if (_user) {
app.locals.user = _user
} else {
delete app.locals.user
}
next()
})
2017-11-06
enctype="multipart/form-data" 提交表单将数据进行分割,支持多种数据混合上传
npm install multiparty --save
var multipart = require('connect-multiparty')
需要在public下新建upload文件夹才能写入
也可以异步上传,控制文件大小
npm install multiparty --save
var multipart = require('connect-multiparty')
需要在public下新建upload文件夹才能写入
也可以异步上传,控制文件大小
2017-10-23
TypeError: Cannot read property 'reply' of null
at D:\nodejs\test\movie\app\controllers\comment.js:23:20
at D:\nodejs\test\movie\app\controllers\comment.js:23:20
2017-10-19