Showing
3 changed files
with
29 additions
and
1 deletions
@@ -259,6 +259,11 @@ var tpl = function(text) { | @@ -259,6 +259,11 @@ var tpl = function(text) { | ||
259 | 259 | ||
260 | require('../../common/promise'); | 260 | require('../../common/promise'); |
261 | 261 | ||
262 | +passwordCaptchaImg.onSuccess(function() { | ||
263 | + // 极验证直接登录 | ||
264 | + loginAsync(); // eslint-disable-line | ||
265 | +}); | ||
266 | + | ||
262 | // 切换登录方式 | 267 | // 切换登录方式 |
263 | accountChangeEvent.add(function(type) { | 268 | accountChangeEvent.add(function(type) { |
264 | currentLogin = AccountLoginData[type]; | 269 | currentLogin = AccountLoginData[type]; |
@@ -826,8 +831,15 @@ function preSmsLoginWithValidate() { | @@ -826,8 +831,15 @@ function preSmsLoginWithValidate() { | ||
826 | /** ************************************************************************/ | 831 | /** ************************************************************************/ |
827 | /* 登录函数 */ | 832 | /* 登录函数 */ |
828 | /** ************************************************************************/ | 833 | /** ************************************************************************/ |
834 | +var loginRunning = false; // eslint-disable-line | ||
829 | 835 | ||
830 | function loginAsync() { | 836 | function loginAsync() { |
837 | + if (loginRunning) { | ||
838 | + return; | ||
839 | + } | ||
840 | + | ||
841 | + loginRunning = true; | ||
842 | + | ||
831 | return currentLogin.validate().then(function() { | 843 | return currentLogin.validate().then(function() { |
832 | return $.ajax({ | 844 | return $.ajax({ |
833 | url: '/passport/login/auth', | 845 | url: '/passport/login/auth', |
@@ -858,6 +870,8 @@ function loginAsync() { | @@ -858,6 +870,8 @@ function loginAsync() { | ||
858 | showQrCodeFailTip(QR_CODE_ERR.fail); | 870 | showQrCodeFailTip(QR_CODE_ERR.fail); |
859 | } | 871 | } |
860 | } | 872 | } |
873 | + }).always(function() { | ||
874 | + loginRunning = false; | ||
861 | }); | 875 | }); |
862 | } | 876 | } |
863 | 877 |
@@ -19,6 +19,8 @@ var GeeCaptcha = function(container, options) { | @@ -19,6 +19,8 @@ var GeeCaptcha = function(container, options) { | ||
19 | this.$tip = this.$container.find('.img-check-tip-gee'); | 19 | this.$tip = this.$container.find('.img-check-tip-gee'); |
20 | this._result = []; | 20 | this._result = []; |
21 | this._captchObj = null; | 21 | this._captchObj = null; |
22 | + this.successCb = null; | ||
23 | + this.refreshCb = null; | ||
22 | 24 | ||
23 | // NODE: 这个是专门给自动化测试做的后门 | 25 | // NODE: 这个是专门给自动化测试做的后门 |
24 | this.$_____trojanYohobuy = this.$container.find('#yohobuy'); | 26 | this.$_____trojanYohobuy = this.$container.find('#yohobuy'); |
@@ -55,7 +57,9 @@ GeeCaptcha.prototype = { | @@ -55,7 +57,9 @@ GeeCaptcha.prototype = { | ||
55 | validate.geetest_validate, | 57 | validate.geetest_validate, |
56 | validate.geetest_seccode | 58 | validate.geetest_seccode |
57 | ]; | 59 | ]; |
60 | + | ||
58 | _this.hideTip(); | 61 | _this.hideTip(); |
62 | + _this.successCb && _this.successCb(); | ||
59 | }); | 63 | }); |
60 | 64 | ||
61 | captchaObj.onFail(function() { | 65 | captchaObj.onFail(function() { |
@@ -66,7 +70,7 @@ GeeCaptcha.prototype = { | @@ -66,7 +70,7 @@ GeeCaptcha.prototype = { | ||
66 | captchaObj.onRefresh(function() { | 70 | captchaObj.onRefresh(function() { |
67 | _this._result = []; | 71 | _this._result = []; |
68 | _this.hideTip(); | 72 | _this.hideTip(); |
69 | - this.refreshCb && _this.refreshCb(); | 73 | + _this.refreshCb && _this.refreshCb(); |
70 | }); | 74 | }); |
71 | 75 | ||
72 | captchaObj.appendTo(_this.$container.find('.img-check-main').get(0)); | 76 | captchaObj.appendTo(_this.$container.find('.img-check-main').get(0)); |
@@ -85,6 +89,11 @@ GeeCaptcha.prototype = { | @@ -85,6 +89,11 @@ GeeCaptcha.prototype = { | ||
85 | return this; | 89 | return this; |
86 | }, | 90 | }, |
87 | 91 | ||
92 | + onSuccess: function(cb) { | ||
93 | + this.successCb = cb; | ||
94 | + return this; | ||
95 | + }, | ||
96 | + | ||
88 | check: function() { | 97 | check: function() { |
89 | var _this = this; | 98 | var _this = this; |
90 | 99 |
-
Please register or login to post a comment