Merge branch 'feature/loginview' into release/6.0.1
Showing
4 changed files
with
26 additions
and
7 deletions
@@ -82,7 +82,20 @@ const load = (req, res, next) => { | @@ -82,7 +82,20 @@ const load = (req, res, next) => { | ||
82 | return next(); | 82 | return next(); |
83 | }; | 83 | }; |
84 | 84 | ||
85 | +/** | ||
86 | + * 测试使用,上线前删除 | ||
87 | + */ | ||
88 | +const forTest = (req, res, next) => { | ||
89 | + if (req.query.image) { | ||
90 | + _.set(req, 'app.locals.wap.geetest.validation', true); | ||
91 | + } else { | ||
92 | + _.set(req, 'app.locals.wap.geetest.validation', false); | ||
93 | + } | ||
94 | + return next(); | ||
95 | +}; | ||
96 | + | ||
85 | module.exports = { | 97 | module.exports = { |
86 | check, | 98 | check, |
87 | - load | 99 | + load, |
100 | + forTest | ||
88 | }; | 101 | }; |
@@ -185,11 +185,17 @@ router.get('/passport/international-new', | @@ -185,11 +185,17 @@ router.get('/passport/international-new', | ||
185 | login.common.clearCookie, | 185 | login.common.clearCookie, |
186 | login.loginShowCaptchaByIp, | 186 | login.loginShowCaptchaByIp, |
187 | loginNew.international); // 国际账号登录 | 187 | loginNew.international); // 国际账号登录 |
188 | -router.get('/passport/reg-new', validateCode.load, regNew.regPage); // 注册页面 | 188 | +router.get('/passport/reg-new', |
189 | + validateCode.forTest, // 测试使用,上灰度前删除 | ||
190 | + validateCode.load, | ||
191 | + regNew.regPage); // 注册页面 | ||
189 | router.post('/passport/register-new', | 192 | router.post('/passport/register-new', |
190 | reg.sendCodeBusyBoy, | 193 | reg.sendCodeBusyBoy, |
191 | regNew.register); // 注册请求 | 194 | regNew.register); // 注册请求 |
192 | -router.get('/passport/sms-login-new', validateCode.load, smsNew.smsLoginPage); // 短信验证码登录 | 195 | +router.get('/passport/sms-login-new', |
196 | + validateCode.forTest, // 测试使用,上灰度前删除 | ||
197 | + validateCode.load, | ||
198 | + smsNew.smsLoginPage); // 短信验证码登录 | ||
193 | router.get('/passport/back/mobile-new', backNew.backByMobile); // 通过手机找回密码 | 199 | router.get('/passport/back/mobile-new', backNew.backByMobile); // 通过手机找回密码 |
194 | router.get('/passport/back/email-new', backNew.backByEmail); // 通过邮箱找回密码 | 200 | router.get('/passport/back/email-new', backNew.backByEmail); // 通过邮箱找回密码 |
195 | router.get('/passport/back/email-success-new', backNew.backByEmailSuccess); // 通过邮箱找回密码成功页 | 201 | router.get('/passport/back/email-success-new', backNew.backByEmailSuccess); // 通过邮箱找回密码成功页 |
@@ -40,9 +40,9 @@ class RegisterNew { | @@ -40,9 +40,9 @@ class RegisterNew { | ||
40 | this.view.passwordEyeIcon.on('click', this.passwordShowStatus.bind(this)); | 40 | this.view.passwordEyeIcon.on('click', this.passwordShowStatus.bind(this)); |
41 | 41 | ||
42 | if ($captcha.data('geetest')) { | 42 | if ($captcha.data('geetest')) { |
43 | - validate.init(); | ||
44 | this.view.getVerifyCodeBtn.on('click', this.getVerifyCode.bind(this)); | 43 | this.view.getVerifyCodeBtn.on('click', this.getVerifyCode.bind(this)); |
45 | } else { | 44 | } else { |
45 | + validate.init(); | ||
46 | this.view.getVerifyCodeBtn.on('click', this.imgVerifyInit.bind(this)); | 46 | this.view.getVerifyCodeBtn.on('click', this.imgVerifyInit.bind(this)); |
47 | } | 47 | } |
48 | } | 48 | } |
@@ -54,7 +54,7 @@ class RegisterNew { | @@ -54,7 +54,7 @@ class RegisterNew { | ||
54 | if (!this.view.getVerifyCodeBtn.hasClass('active')) { | 54 | if (!this.view.getVerifyCodeBtn.hasClass('active')) { |
55 | return; | 55 | return; |
56 | } | 56 | } |
57 | - validate.init(); | 57 | + validate.refresh(); |
58 | $(document).off('click.refresh').on('click.refresh', '.img-check-refresh', this.imgVerifyInit.bind(this)); | 58 | $(document).off('click.refresh').on('click.refresh', '.img-check-refresh', this.imgVerifyInit.bind(this)); |
59 | if (!$('#getVerifyCodeBtnByValidate').length) { | 59 | if (!$('#getVerifyCodeBtnByValidate').length) { |
60 | $captcha.append('<div class="validate-sub-btn"><button id="getVerifyCodeBtnByValidate">获取验证码</button></div>'); // eslint-disable-line | 60 | $captcha.append('<div class="validate-sub-btn"><button id="getVerifyCodeBtnByValidate">获取验证码</button></div>'); // eslint-disable-line |
@@ -44,9 +44,9 @@ class SmsLoginNew extends Page { | @@ -44,9 +44,9 @@ class SmsLoginNew extends Page { | ||
44 | this.selector.smsLoginBtn.on('click', this.login.bind(this)); | 44 | this.selector.smsLoginBtn.on('click', this.login.bind(this)); |
45 | 45 | ||
46 | if ($captcha.data('geetest')) { | 46 | if ($captcha.data('geetest')) { |
47 | - validate.init(); | ||
48 | this.selector.getVerifyCodeBtn.on('click', this.getVerifyCode.bind(this)); | 47 | this.selector.getVerifyCodeBtn.on('click', this.getVerifyCode.bind(this)); |
49 | } else { | 48 | } else { |
49 | + validate.init(); | ||
50 | this.selector.getVerifyCodeBtn.on('click', this.imgVerifyInit.bind(this)); | 50 | this.selector.getVerifyCodeBtn.on('click', this.imgVerifyInit.bind(this)); |
51 | } | 51 | } |
52 | } | 52 | } |
@@ -58,7 +58,7 @@ class SmsLoginNew extends Page { | @@ -58,7 +58,7 @@ class SmsLoginNew extends Page { | ||
58 | if (!this.selector.getVerifyCodeBtn.hasClass('active')) { | 58 | if (!this.selector.getVerifyCodeBtn.hasClass('active')) { |
59 | return; | 59 | return; |
60 | } | 60 | } |
61 | - validate.init(); | 61 | + validate.refresh(); |
62 | $(document).off('click.refresh').on('click.refresh', '.img-check-refresh', this.imgVerifyInit.bind(this)); | 62 | $(document).off('click.refresh').on('click.refresh', '.img-check-refresh', this.imgVerifyInit.bind(this)); |
63 | if (!$('#getVerifyCodeBtnByValidate').length) { | 63 | if (!$('#getVerifyCodeBtnByValidate').length) { |
64 | $captcha.append('<div class="validate-sub-btn"><button id="getVerifyCodeBtnByValidate">获取验证码</button></div>'); // eslint-disable-line | 64 | $captcha.append('<div class="validate-sub-btn"><button id="getVerifyCodeBtnByValidate">获取验证码</button></div>'); // eslint-disable-line |
-
Please register or login to post a comment