From 62172db59be72bfd2eb29dd841b231f4baba5eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Wed, 12 Jul 2023 17:13:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9D=A1=E4=BB=B6=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E5=90=8D=E8=BE=93=E5=85=A5=E6=A1=86=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E5=A4=9A=E4=B8=AA=E6=89=A9=E5=B1=95=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/http-cond-definitions.js | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/web/public/js/components/server/http-cond-definitions.js b/web/public/js/components/server/http-cond-definitions.js index 9a21c6bf..f4f07f1a 100644 --- a/web/public/js/components/server/http-cond-definitions.js +++ b/web/public/js/components/server/http-cond-definitions.js @@ -54,11 +54,18 @@ Vue.component("http-cond-url-extension", { if (this.addingExt.length == 0) { return } - if (this.addingExt[0] != ".") { - this.addingExt = "." + this.addingExt - } - this.addingExt = this.addingExt.replace(/\s+/g, "").toLowerCase() - this.extensions.push(this.addingExt) + + let that = this + this.addingExt.split(/[,;,;|]/).forEach(function (ext) { + ext = ext.trim() + if (ext.length > 0) { + if (ext[0] != ".") { + ext = "." + ext + } + ext = ext.replace(/\s+/g, "").toLowerCase() + that.extensions.push(ext) + } + }) // 清除状态 this.cancelAdding() @@ -70,12 +77,12 @@ Vue.component("http-cond-url-extension", { template: `
-
{{ext}}
+
{{ext}}
- +
@@ -85,7 +92,7 @@ Vue.component("http-cond-url-extension", {
-

扩展名需要包含点(.)符号,例如.jpg.png之类。

+

扩展名需要包含点(.)符号,例如.jpg.png之类;多个扩展名用逗号分割。

` })