Showing
6 changed files
with
55 additions
and
50 deletions
@@ -82,6 +82,12 @@ const common = { | @@ -82,6 +82,12 @@ const common = { | ||
82 | 82 | ||
83 | const local = { | 83 | const local = { |
84 | loginPage: (req, res) => { | 84 | loginPage: (req, res) => { |
85 | + // 是否关闭账号登录 | ||
86 | + let closePassword = _.get(req.app.locals.wap, 'close.passwordLogin', false); | ||
87 | + | ||
88 | + if (closePassword) { | ||
89 | + return res.redirect(`/signin.html?refer=${req.query.refer || ''}`); | ||
90 | + } | ||
85 | if (req.session.captchaValidCount == null) { // eslint-disable-line | 91 | if (req.session.captchaValidCount == null) { // eslint-disable-line |
86 | req.session.captchaValidCount = 5; | 92 | req.session.captchaValidCount = 5; |
87 | } | 93 | } |
@@ -182,6 +188,15 @@ const local = { | @@ -182,6 +188,15 @@ const local = { | ||
182 | }); | 188 | }); |
183 | }, | 189 | }, |
184 | login: (req, res, next) => { | 190 | login: (req, res, next) => { |
191 | + // 是否关闭账号登录 | ||
192 | + let closePassword = _.get(req.app.locals.wap, 'close.passwordLogin', false); | ||
193 | + | ||
194 | + if (closePassword) { | ||
195 | + return res.json({ | ||
196 | + code: 403, | ||
197 | + message: '请使用快速登录' | ||
198 | + }); | ||
199 | + } | ||
185 | 200 | ||
186 | // 使用极验证 | 201 | // 使用极验证 |
187 | let useGeetest = !_.get(req.app.locals.wap, 'geetest.validation', false); | 202 | let useGeetest = !_.get(req.app.locals.wap, 'geetest.validation', false); |
@@ -44,43 +44,9 @@ const _step1 = (req, res, next) => { | @@ -44,43 +44,9 @@ const _step1 = (req, res, next) => { | ||
44 | req.session.captchaValidCount = 5; | 44 | req.session.captchaValidCount = 5; |
45 | } | 45 | } |
46 | 46 | ||
47 | + // 是否打开账号登录 | ||
48 | + let openPassword = !_.get(req.app.locals.wap, 'close.passwordLogin', false); | ||
47 | let template = 'sms/login'; | 49 | let template = 'sms/login'; |
48 | - | ||
49 | - // let viewData = { | ||
50 | - // width750: true, | ||
51 | - // module: 'passport', | ||
52 | - // page: 'sms-login', | ||
53 | - // title: '手机短信登录', | ||
54 | - // isPassportPage: true, | ||
55 | - // headerText: '手机号码快捷登录', | ||
56 | - // captchaUrl: helpers.urlFormat('/passport/sms_login/captcha.png', {t: Date.now()}), | ||
57 | - // areaCode: '+86', // 默认的区号 | ||
58 | - // countrys: RegService.getAreaData() // 地区信息列表 | ||
59 | - // }; | ||
60 | - | ||
61 | - // 登陆切换到短信登陆 | ||
62 | - // let viewData = { | ||
63 | - // width750: true, | ||
64 | - // module: 'passport', | ||
65 | - // page: 'sms-login', | ||
66 | - // backUrl: 'javascript:history.go(-1)', // eslint-disable-line | ||
67 | - // showHeaderImg: true, // 控制显示头部图片 | ||
68 | - // title: '手机短信登录', | ||
69 | - // isPassportPage: true, | ||
70 | - // captchaUrl: helpers.urlFormat('/passport/sms_login/captcha.png', {t: Date.now()}), | ||
71 | - // smsLoginUrl: '/passport/sms_login', | ||
72 | - // registerUrl: '/passport/reg/index', // 注册的URL链接 | ||
73 | - // aliLoginUrl: '/passport/login/alipay', // 支付宝快捷登录的URL链接 | ||
74 | - // weiboLoginUrl: '/passport/login/sina', // 微博登录的URL链接 | ||
75 | - // qqLoginUrl: '/passport/login/qq', // 腾讯QQ登录的URL链接 | ||
76 | - // wechatLoginUrl: '/passport/login/wechat', // 微信登录的URL链接 | ||
77 | - // internationalUrl: '/passport/international', // 国际号登录的URL链接 | ||
78 | - // phoneRetriveUrl: '/passport/back/mobile', // 通过手机号找回密码的URL链接 | ||
79 | - // emailRetriveUrl: '/passport/back/email', // 通过邮箱找回密码的URL链接 | ||
80 | - // areaCode: '+86', // 默认的区号 | ||
81 | - // countrys: RegService.getAreaData(), // 地区信息列表 | ||
82 | - // reg: true | ||
83 | - // }; | ||
84 | let viewData = { | 50 | let viewData = { |
85 | width750: true, | 51 | width750: true, |
86 | module: 'passport', | 52 | module: 'passport', |
@@ -102,6 +68,7 @@ const _step1 = (req, res, next) => { | @@ -102,6 +68,7 @@ const _step1 = (req, res, next) => { | ||
102 | emailRetriveUrl: '/passport/back/email', // 通过邮箱找回密码的URL链接 | 68 | emailRetriveUrl: '/passport/back/email', // 通过邮箱找回密码的URL链接 |
103 | areaCode: '+86', // 默认的区号 | 69 | areaCode: '+86', // 默认的区号 |
104 | countrys: RegService.getAreaData(), // 地区信息列表 | 70 | countrys: RegService.getAreaData(), // 地区信息列表 |
71 | + openPassword, | ||
105 | reg: true | 72 | reg: true |
106 | }; | 73 | }; |
107 | 74 |
@@ -14,7 +14,9 @@ | @@ -14,7 +14,9 @@ | ||
14 | {{!--图片验证 end--}} | 14 | {{!--图片验证 end--}} |
15 | <button id="btn-next" class="btn btn-next disable row" disabled>获取短信验证码</button> | 15 | <button id="btn-next" class="btn btn-next disable row" disabled>获取短信验证码</button> |
16 | <p class="op-container"> | 16 | <p class="op-container"> |
17 | + {{#if openPassword}} | ||
17 | <a class="op-item internat" href={{accountUrl}}>账号密码登录</a> | 18 | <a class="op-item internat" href={{accountUrl}}>账号密码登录</a> |
19 | + {{/if}} | ||
18 | <span id="forget-pwd" class="op-item forget-pwd">忘记密码</span> | 20 | <span id="forget-pwd" class="op-item forget-pwd">忘记密码</span> |
19 | </p> | 21 | </p> |
20 | <div class="third-party-login"> | 22 | <div class="third-party-login"> |
@@ -8,7 +8,9 @@ var $countrySelect, | @@ -8,7 +8,9 @@ var $countrySelect, | ||
8 | $resetBtn, | 8 | $resetBtn, |
9 | $captcha, | 9 | $captcha, |
10 | $captchaPNG, | 10 | $captchaPNG, |
11 | - $phoneNum; | 11 | + $phoneNum, |
12 | + $mask = $('#retrive-pwd-mask'), | ||
13 | + $ways = $('#retrive-pwd-ways'); | ||
12 | 14 | ||
13 | var page; | 15 | var page; |
14 | 16 | ||
@@ -67,8 +69,27 @@ page = { | @@ -67,8 +69,27 @@ page = { | ||
67 | .toggleClass('disable', true); | 69 | .toggleClass('disable', true); |
68 | $resetBtn.hide(); | 70 | $resetBtn.hide(); |
69 | }); | 71 | }); |
70 | - }, | 72 | + $('#forget-pwd').on('touchstart', () => { |
73 | + this.showRetrivePanel(); | ||
74 | + }); | ||
75 | + | ||
76 | + $mask.on('touchstart', () => { | ||
77 | + this.hideRetrivePanel(); | ||
78 | + }); | ||
71 | 79 | ||
80 | + $('#cancel-retrive').on('touchstart', (e) => { | ||
81 | + e.preventDefault(); | ||
82 | + this.hideRetrivePanel(); | ||
83 | + }); | ||
84 | + }, | ||
85 | + showRetrivePanel: () => { | ||
86 | + $mask.show(); | ||
87 | + $ways.show(); | ||
88 | + }, | ||
89 | + hideRetrivePanel: () => { | ||
90 | + $mask.hide(); | ||
91 | + $ways.hide(); | ||
92 | + }, | ||
72 | // 切换$nextBtn disable状态 | 93 | // 切换$nextBtn disable状态 |
73 | toggleNextBtn: function() { | 94 | toggleNextBtn: function() { |
74 | var bool = Boolean($.trim($phoneNum.val())); | 95 | var bool = Boolean($.trim($phoneNum.val())); |
@@ -19,18 +19,18 @@ | @@ -19,18 +19,18 @@ | ||
19 | margin: 20PX 0; | 19 | margin: 20PX 0; |
20 | text-align: center; | 20 | text-align: center; |
21 | font-size: 16PX; | 21 | font-size: 16PX; |
22 | - display: flex; | ||
23 | 22 | ||
24 | .op-item { | 23 | .op-item { |
25 | - flex: 1; | 24 | + margin: 0 auto; |
26 | color: #fff; | 25 | color: #fff; |
27 | } | 26 | } |
28 | 27 | ||
29 | - .internat { | 28 | + .op-item:first-child { |
29 | + float: left; | ||
30 | text-align: left; | 30 | text-align: left; |
31 | } | 31 | } |
32 | - | ||
33 | - .forget-pwd { | 32 | + .op-item:last-child { |
33 | + float: right; | ||
34 | text-align: right; | 34 | text-align: right; |
35 | } | 35 | } |
36 | } | 36 | } |
@@ -44,25 +44,25 @@ | @@ -44,25 +44,25 @@ | ||
44 | color: #858585; | 44 | color: #858585; |
45 | } | 45 | } |
46 | } | 46 | } |
47 | - | ||
48 | -.op-container { | 47 | + .op-container { |
49 | position: relative; | 48 | position: relative; |
50 | width: 100%; | 49 | width: 100%; |
51 | margin: 20PX 0; | 50 | margin: 20PX 0; |
51 | + height: 40px; | ||
52 | text-align: center; | 52 | text-align: center; |
53 | font-size: 16PX; | 53 | font-size: 16PX; |
54 | - display: flex; | ||
55 | 54 | ||
56 | .op-item { | 55 | .op-item { |
57 | - flex: 1; | 56 | + margin: 0 auto; |
58 | color: #fff; | 57 | color: #fff; |
59 | } | 58 | } |
60 | 59 | ||
61 | - .internat { | 60 | + .op-item:first-child { |
61 | + float: left; | ||
62 | text-align: left; | 62 | text-align: left; |
63 | } | 63 | } |
64 | - | ||
65 | - .forget-pwd { | 64 | + .op-item:last-child { |
65 | + float: right; | ||
66 | text-align: right; | 66 | text-align: right; |
67 | } | 67 | } |
68 | } | 68 | } |
-
Please register or login to post a comment