mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-15 13:00:25 +08:00
CAPTCHA增加多个选项
This commit is contained in:
@@ -5077,6 +5077,8 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
blockScope: "global",
|
blockScope: "global",
|
||||||
|
|
||||||
captchaLife: "",
|
captchaLife: "",
|
||||||
|
captchaMaxFails: "",
|
||||||
|
captchaFailBlockTimeout: "",
|
||||||
get302Life: "",
|
get302Life: "",
|
||||||
post307Life: "",
|
post307Life: "",
|
||||||
recordIPType: "black",
|
recordIPType: "black",
|
||||||
@@ -5125,6 +5127,22 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
this.actionOptions["life"] = v
|
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) {
|
get302Life: function (v) {
|
||||||
v = parseInt(v)
|
v = parseInt(v)
|
||||||
if (isNaN(v)) {
|
if (isNaN(v)) {
|
||||||
@@ -5191,6 +5209,8 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
this.blockTimeout = ""
|
this.blockTimeout = ""
|
||||||
this.blockScope = "global"
|
this.blockScope = "global"
|
||||||
this.captchaLife = ""
|
this.captchaLife = ""
|
||||||
|
this.captchaMaxFails = ""
|
||||||
|
this.captchaFailBlockTimeout = ""
|
||||||
this.get302Life = ""
|
this.get302Life = ""
|
||||||
this.post307Life = ""
|
this.post307Life = ""
|
||||||
|
|
||||||
@@ -5259,6 +5279,14 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
if (config.options.life != null || config.options.life > 0) {
|
if (config.options.life != null || config.options.life > 0) {
|
||||||
this.captchaLife = config.options.life.toString()
|
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
|
break
|
||||||
case "notify":
|
case "notify":
|
||||||
break
|
break
|
||||||
@@ -5586,6 +5614,26 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
<p class="comment">验证通过后在这个时间内不再验证,默认600秒。</p>
|
<p class="comment">验证通过后在这个时间内不再验证,默认600秒。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr v-if="actionCode == 'captcha'">
|
||||||
|
<td>最多失败次数</td>
|
||||||
|
<td>
|
||||||
|
<div class="ui input right labeled">
|
||||||
|
<input type="text" style="width: 5em" maxlength="9" v-model="captchaMaxFails" @keyup.enter="confirm()" @keypress.enter.prevent="1"/>
|
||||||
|
<span class="ui label">次</span>
|
||||||
|
</div>
|
||||||
|
<p class="comment">如果为空或者为0,表示不限制。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr v-if="actionCode == 'captcha'">
|
||||||
|
<td>失败拦截时间</td>
|
||||||
|
<td>
|
||||||
|
<div class="ui input right labeled">
|
||||||
|
<input type="text" style="width: 5em" maxlength="9" v-model="captchaFailBlockTimeout" @keyup.enter="confirm()" @keypress.enter.prevent="1"/>
|
||||||
|
<span class="ui label">秒</span>
|
||||||
|
</div>
|
||||||
|
<p class="comment">在达到最多失败次数(大于0)时,自动拦截的时间;如果为0表示不自动拦截。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<!-- get_302 -->
|
<!-- get_302 -->
|
||||||
<tr v-if="actionCode == 'get_302'">
|
<tr v-if="actionCode == 'get_302'">
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
blockScope: "global",
|
blockScope: "global",
|
||||||
|
|
||||||
captchaLife: "",
|
captchaLife: "",
|
||||||
|
captchaMaxFails: "",
|
||||||
|
captchaFailBlockTimeout: "",
|
||||||
get302Life: "",
|
get302Life: "",
|
||||||
post307Life: "",
|
post307Life: "",
|
||||||
recordIPType: "black",
|
recordIPType: "black",
|
||||||
@@ -124,6 +126,22 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
this.actionOptions["life"] = v
|
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) {
|
get302Life: function (v) {
|
||||||
v = parseInt(v)
|
v = parseInt(v)
|
||||||
if (isNaN(v)) {
|
if (isNaN(v)) {
|
||||||
@@ -190,6 +208,8 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
this.blockTimeout = ""
|
this.blockTimeout = ""
|
||||||
this.blockScope = "global"
|
this.blockScope = "global"
|
||||||
this.captchaLife = ""
|
this.captchaLife = ""
|
||||||
|
this.captchaMaxFails = ""
|
||||||
|
this.captchaFailBlockTimeout = ""
|
||||||
this.get302Life = ""
|
this.get302Life = ""
|
||||||
this.post307Life = ""
|
this.post307Life = ""
|
||||||
|
|
||||||
@@ -258,6 +278,14 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
if (config.options.life != null || config.options.life > 0) {
|
if (config.options.life != null || config.options.life > 0) {
|
||||||
this.captchaLife = config.options.life.toString()
|
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
|
break
|
||||||
case "notify":
|
case "notify":
|
||||||
break
|
break
|
||||||
@@ -585,6 +613,26 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
<p class="comment">验证通过后在这个时间内不再验证,默认600秒。</p>
|
<p class="comment">验证通过后在这个时间内不再验证,默认600秒。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr v-if="actionCode == 'captcha'">
|
||||||
|
<td>最多失败次数</td>
|
||||||
|
<td>
|
||||||
|
<div class="ui input right labeled">
|
||||||
|
<input type="text" style="width: 5em" maxlength="9" v-model="captchaMaxFails" @keyup.enter="confirm()" @keypress.enter.prevent="1"/>
|
||||||
|
<span class="ui label">次</span>
|
||||||
|
</div>
|
||||||
|
<p class="comment">如果为空或者为0,表示不限制。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr v-if="actionCode == 'captcha'">
|
||||||
|
<td>失败拦截时间</td>
|
||||||
|
<td>
|
||||||
|
<div class="ui input right labeled">
|
||||||
|
<input type="text" style="width: 5em" maxlength="9" v-model="captchaFailBlockTimeout" @keyup.enter="confirm()" @keypress.enter.prevent="1"/>
|
||||||
|
<span class="ui label">秒</span>
|
||||||
|
</div>
|
||||||
|
<p class="comment">在达到最多失败次数(大于0)时,自动拦截的时间;如果为0表示不自动拦截。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<!-- get_302 -->
|
<!-- get_302 -->
|
||||||
<tr v-if="actionCode == 'get_302'">
|
<tr v-if="actionCode == 'get_302'">
|
||||||
|
|||||||
Reference in New Issue
Block a user