Authored by htoooth

fix

... ... @@ -98,8 +98,8 @@ app.use((req, res, next) => {
// req.app.locals = _.merge(req.app.locals, {
// pc: {
// login: {
// closePasswordLogin: true
// geetest: {
// validation: true
// }
// }
// });
... ...
... ... @@ -53,13 +53,12 @@ passport.use('local', new LocalStrategy({
let clientIp = req.yoho.clientIp;
let errorLoginKey = 'loginErrorIp:' + clientIp;
let closePasswordLogin = _.get(req.app.locals.pc, 'login.closePasswordLogin', false);
let close = _.get(req.app.locals.pc, 'login.closePasswordLogin', false);
getLoginStat(clientIp).then((times) => {
let errLoginTimes = _.parseInt(times) || 0;
return LoginApi.signin(type, area, username, password, shoppingKey, clientIp, closePasswordLogin).
then((result) => {
return LoginApi.signin(type, area, username, password, shoppingKey, clientIp, close).then((result) => {
if (result.code && (result.code === 200 || result.code === 510) && result.data.uid) {
cache.del(errorLoginKey).catch(() => {});
req.session.type = '';
... ...