diff --git a/src/giffgaff/giffgaff_modular.html b/src/giffgaff/giffgaff_modular.html index 011f583..e7071df 100644 --- a/src/giffgaff/giffgaff_modular.html +++ b/src/giffgaff/giffgaff_modular.html @@ -21,7 +21,7 @@ - + Giffgaff eSIM 工具 diff --git a/src/js/modules/captcha-manager.js b/src/js/modules/captcha-manager.js index 3e05e9e..3f50d5d 100644 --- a/src/js/modules/captcha-manager.js +++ b/src/js/modules/captcha-manager.js @@ -9,6 +9,8 @@ class CaptchaManager { this.recaptchaWidgetId = null; this.recaptchaReadyResolver = null; this.recaptchaReadyPromise = null; + this.recaptchaErrorCount = 0; + this.recaptchaMaxRetries = 3; } async init() { @@ -70,13 +72,19 @@ class CaptchaManager { size: 'invisible', callback: (token) => { this.storeToken(token); + this.recaptchaErrorCount = 0; }, 'expired-callback': () => { this.storeToken(undefined); this.executeRecaptcha(); }, 'error-callback': () => { - setTimeout(() => this.executeRecaptcha(), 1000); + this.recaptchaErrorCount++; + if (this.recaptchaErrorCount <= this.recaptchaMaxRetries) { + setTimeout(() => this.executeRecaptcha(), 1000); + } else { + console.warn('[CaptchaManager] reCAPTCHA 连续失败次数超限,停止重试'); + } } }); this.executeRecaptcha(); diff --git a/src/simyo/simyo_modular.html b/src/simyo/simyo_modular.html index 9592cbf..e08d735 100644 --- a/src/simyo/simyo_modular.html +++ b/src/simyo/simyo_modular.html @@ -47,7 +47,7 @@ - + Simyo NL eSIM 工具