From 021dc13ce908801db4169f14031f07038a73433d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sun, 16 Jan 2022 16:54:20 +0800 Subject: [PATCH] =?UTF-8?q?CAPTCHA=E5=A2=9E=E5=8A=A0=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/public/js/components.js | 48 +++++++++++++++++++ .../server/http-firewall-actions-box.js | 48 +++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/web/public/js/components.js b/web/public/js/components.js index 0ffe4ad7..b76e983c 100755 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -5077,6 +5077,8 @@ Vue.component("http-firewall-actions-box", { blockScope: "global", captchaLife: "", + captchaMaxFails: "", + captchaFailBlockTimeout: "", get302Life: "", post307Life: "", recordIPType: "black", @@ -5125,6 +5127,22 @@ Vue.component("http-firewall-actions-box", { this.actionOptions["life"] = v } }, + captchaMaxFails: function (v) { + v = parseInt(v) + if (isNaN(v)) { + this.actionOptions["maxFails"] = 0 + } else { + this.actionOptions["maxFails"] = v + } + }, + captchaFailBlockTimeout: function (v) { + v = parseInt(v) + if (isNaN(v)) { + this.actionOptions["failBlockTimeout"] = 0 + } else { + this.actionOptions["failBlockTimeout"] = v + } + }, get302Life: function (v) { v = parseInt(v) if (isNaN(v)) { @@ -5191,6 +5209,8 @@ Vue.component("http-firewall-actions-box", { this.blockTimeout = "" this.blockScope = "global" this.captchaLife = "" + this.captchaMaxFails = "" + this.captchaFailBlockTimeout = "" this.get302Life = "" this.post307Life = "" @@ -5259,6 +5279,14 @@ Vue.component("http-firewall-actions-box", { if (config.options.life != null || config.options.life > 0) { this.captchaLife = config.options.life.toString() } + this.captchaMaxFails = "" + if (config.options.maxFails != null || config.options.maxFails > 0) { + this.captchaMaxFails = config.options.maxFails.toString() + } + this.captchaFailBlockTimeout = "" + if (config.options.failBlockTimeout != null || config.options.failBlockTimeout > 0) { + this.captchaFailBlockTimeout = config.options.failBlockTimeout.toString() + } break case "notify": break @@ -5586,6 +5614,26 @@ Vue.component("http-firewall-actions-box", {

验证通过后在这个时间内不再验证,默认600秒。

+ + 最多失败次数 + +
+ + +
+

如果为空或者为0,表示不限制。

+ + + + 失败拦截时间 + +
+ + +
+

在达到最多失败次数(大于0)时,自动拦截的时间;如果为0表示不自动拦截。

+ + diff --git a/web/public/js/components/server/http-firewall-actions-box.js b/web/public/js/components/server/http-firewall-actions-box.js index 448137d9..924711b5 100644 --- a/web/public/js/components/server/http-firewall-actions-box.js +++ b/web/public/js/components/server/http-firewall-actions-box.js @@ -76,6 +76,8 @@ Vue.component("http-firewall-actions-box", { blockScope: "global", captchaLife: "", + captchaMaxFails: "", + captchaFailBlockTimeout: "", get302Life: "", post307Life: "", recordIPType: "black", @@ -124,6 +126,22 @@ Vue.component("http-firewall-actions-box", { this.actionOptions["life"] = v } }, + captchaMaxFails: function (v) { + v = parseInt(v) + if (isNaN(v)) { + this.actionOptions["maxFails"] = 0 + } else { + this.actionOptions["maxFails"] = v + } + }, + captchaFailBlockTimeout: function (v) { + v = parseInt(v) + if (isNaN(v)) { + this.actionOptions["failBlockTimeout"] = 0 + } else { + this.actionOptions["failBlockTimeout"] = v + } + }, get302Life: function (v) { v = parseInt(v) if (isNaN(v)) { @@ -190,6 +208,8 @@ Vue.component("http-firewall-actions-box", { this.blockTimeout = "" this.blockScope = "global" this.captchaLife = "" + this.captchaMaxFails = "" + this.captchaFailBlockTimeout = "" this.get302Life = "" this.post307Life = "" @@ -258,6 +278,14 @@ Vue.component("http-firewall-actions-box", { if (config.options.life != null || config.options.life > 0) { this.captchaLife = config.options.life.toString() } + this.captchaMaxFails = "" + if (config.options.maxFails != null || config.options.maxFails > 0) { + this.captchaMaxFails = config.options.maxFails.toString() + } + this.captchaFailBlockTimeout = "" + if (config.options.failBlockTimeout != null || config.options.failBlockTimeout > 0) { + this.captchaFailBlockTimeout = config.options.failBlockTimeout.toString() + } break case "notify": break @@ -585,6 +613,26 @@ Vue.component("http-firewall-actions-box", {

验证通过后在这个时间内不再验证,默认600秒。

+ + 最多失败次数 + +
+ + +
+

如果为空或者为0,表示不限制。

+ + + + 失败拦截时间 + +
+ + +
+

在达到最多失败次数(大于0)时,自动拦截的时间;如果为0表示不自动拦截。

+ +