login-new.js
1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const _ = require('lodash');
// const passport = require('passport');
// const uuid = require('uuid');
// const co = Promise.coroutine;
// const cookie = global.yoho.cookie;
// const helpers = global.yoho.helpers;
// const log = global.yoho.logger;
// const config = global.yoho.config;
// const cache = global.yoho.cache;
// const utils = require(global.utils);
// const RegService = require('../models/reg-service');
// const AuthHelper = require('../models/auth-helper');
// const resources = {
// yohobuy: '',
// yohomars: '',
// yohocoffee: ''
// };
class Login {
/**
* 登录页面
*/
loginPage(req, res) {
// 是否关闭账号登录
let closePassword = _.get(req.app.locals.wap, 'close.passwordLogin', false);
if (closePassword) {
return res.redirect(`/signin.html?refer=${req.query.refer || ''}`);
}
if (req.session.captchaValidCount == null) { // eslint-disable-line
req.session.captchaValidCount = 5;
}
res.render('login/login-new', {
module: 'passport',
page: 'login-new',
width750: true,
captchaShow: req.yoho.captchaShow,
});
}
/**
* 国际账号登录
*/
international(req, res) {
// 是否关闭账号登录
let closePassword = _.get(req.app.locals.wap, 'close.passwordLogin', false);
if (closePassword) {
return res.redirect(`/signin.html?refer=${req.query.refer || ''}`);
}
if (req.session.captchaValidCount == null) { // eslint-disable-line
req.session.captchaValidCount = 5;
}
res.render('login/international-new', {
module: 'passport',
page: 'international-new',
width750: true,
captchaShow: req.yoho.captchaShow,
});
}
}
module.exports = Login;