防盗链功能增加禁止的来源域名

This commit is contained in:
GoEdgeLab
2022-10-24 10:20:44 +08:00
parent 300c4e133c
commit 3505b9107b
6 changed files with 42 additions and 8 deletions

View File

@@ -8,12 +8,16 @@ Vue.component("http-referers-config-box", {
isOn: false,
allowEmpty: true,
allowSameDomain: true,
allowDomains: []
allowDomains: [],
denyDomains: []
}
}
if (config.allowDomains == null) {
config.allowDomains = []
}
if (config.denyDomains == null) {
config.denyDomains = []
}
return {
config: config
}
@@ -23,6 +27,8 @@ Vue.component("http-referers-config-box", {
return ((!this.vIsLocation && !this.vIsGroup) || this.config.isPrior) && this.config.isOn
},
changeAllowDomains: function (domains) {
},
changeDenyDomains: function (domains) {
}
},
template: `<div>
@@ -63,6 +69,13 @@ Vue.component("http-referers-config-box", {
<p class="comment">允许的其他来源域名列表,比如<code-label>example.com</code-label>、<code-label>*.example.com</code-label>。单个星号<code-label>*</code-label>表示允许所有域名。</p>
</td>
</tr>
<tr>
<td>禁止的来源域名</td>
<td>
<values-box :values="config.denyDomains" @change="changeDenyDomains"></values-box>
<p class="comment">禁止的来源域名列表,比如<code-label>example.org</code-label>、<code-label>*.example.org</code-label>;除了这些禁止的来源域名外,其他域名都会被允许,除非限定了允许的来源域名。</p>
</td>
</tr>
</tbody>
</table>
<div class="ui margin"></div>