调用req.flash('error', '用户已存在!'); 时候 报错 "req.flash is not a function"
var session = require(‘express-session’); var MongoStore = require(‘connect-mongo’)(session); app.use(session({ secret: settings.cookieSecret, key: settings.db,//cookie name cookie: { maxAge: 1000 * 60 * 60 * 24 * 30 },//30 days store: new MongoStore({ url: ‘mongodb://localhost/blogdb’ }), resave: true, saveUninitialized: true }));
var flash = require(‘connect-flash’); app.use(flash());
我已经在app.js里面用use flash connect-flash 这个我也安装了
-
- 这个报错莫名其妙的 求拯救
1 回复