Authored by 郭成尧

login-problem

... ... @@ -60,7 +60,7 @@ app.use(bodyParser.urlencoded({
app.use(cookieParser());
app.use(session({
name: 'yohobuy_session',
name: 'yohobuy_session_cookie',
secret: '82dd7e724f2c6870472c89dfa43cf48d'
}));
... ...
... ... @@ -14,7 +14,7 @@ const QQStrategy = require('passport-qq').Strategy;
const AlipayStrategy = require('./models/passport-alipay').Strategy;
const _ = require('lodash');
const md5 = require('md5');
// const md5 = require('md5');
const config = global.yoho.config;
const logger = global.yoho.logger;
... ... @@ -51,11 +51,11 @@ passport.use(new LocalStrategy({
return done('登录账号格式错误', null);
}
let expire = req.cookies['LE' + md5('_LOGIN_EXPIRE')];
// let expire = req.cookies['LE' + md5('_LOGIN_EXPIRE')];
if (_.isEmpty(expire) || expire < (new Date()).getTime() / 1000) {
return done('页面停留时间过长,请刷新页面', null);
}
// if (_.isEmpty(expire) || expire < (new Date()).getTime() / 1000) {
// return done('页面停留时间过长,请刷新页面', null);
// }
let shoppingKey = cookie.getShoppingKey(req);
... ...
... ... @@ -40,9 +40,9 @@ module.exports = {
trace: false,
useCache: true,
memcache: {
master: ['127.0.0.1:11211'],
slave: ['127.0.0.1:11211'],
session: ['127.0.0.1:11211'],
master: ['192.168.102.168:11211'],
slave: ['192.168.102.168:11211'],
session: ['192.168.102.168:11211'],
poolSize: 25,
reconnect: 5000,
timeout: 1000,
... ...