Authored by htoooth

fix gee

... ... @@ -259,6 +259,11 @@ var tpl = function(text) {
require('../../common/promise');
passwordCaptchaImg.onSuccess(function() {
// 极验证直接登录
loginAsync(); // eslint-disable-line
});
// 切换登录方式
accountChangeEvent.add(function(type) {
currentLogin = AccountLoginData[type];
... ... @@ -826,8 +831,15 @@ function preSmsLoginWithValidate() {
/** ************************************************************************/
/* 登录函数 */
/** ************************************************************************/
var loginRunning = false; // eslint-disable-line
function loginAsync() {
if (loginRunning) {
return;
}
loginRunning = true;
return currentLogin.validate().then(function() {
return $.ajax({
url: '/passport/login/auth',
... ... @@ -858,6 +870,8 @@ function loginAsync() {
showQrCodeFailTip(QR_CODE_ERR.fail);
}
}
}).always(function() {
loginRunning = false;
});
}
... ...
... ... @@ -19,6 +19,8 @@ var GeeCaptcha = function(container, options) {
this.$tip = this.$container.find('.img-check-tip-gee');
this._result = [];
this._captchObj = null;
this.successCb = null;
this.refreshCb = null;
// NODE: 这个是专门给自动化测试做的后门
this.$_____trojanYohobuy = this.$container.find('#yohobuy');
... ... @@ -55,7 +57,9 @@ GeeCaptcha.prototype = {
validate.geetest_validate,
validate.geetest_seccode
];
_this.hideTip();
_this.successCb && _this.successCb();
});
captchaObj.onFail(function() {
... ... @@ -66,7 +70,7 @@ GeeCaptcha.prototype = {
captchaObj.onRefresh(function() {
_this._result = [];
_this.hideTip();
this.refreshCb && _this.refreshCb();
_this.refreshCb && _this.refreshCb();
});
captchaObj.appendTo(_this.$container.find('.img-check-main').get(0));
... ... @@ -85,6 +89,11 @@ GeeCaptcha.prototype = {
return this;
},
onSuccess: function(cb) {
this.successCb = cb;
return this;
},
check: function() {
var _this = this;
... ...
... ... @@ -118,6 +118,11 @@ Captcha.prototype = {
return this;
},
onSuccess: function() {
// pass
return this;
},
/**
* 检查是否正确
*/
... ...