From b08eb6bf1fcbc86dec2392da6e144f099e777d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Mon, 11 Nov 2024 00:47:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E8=87=AA=E5=8A=A8=E6=B8=85=E7=90=86=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84=E6=96=9C=E6=9D=A0=E5=92=8C=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/utils/file/index.ts | 2 +- web/src/views/file/PathInput.vue | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/utils/file/index.ts b/web/src/utils/file/index.ts index 057b5933..03521d48 100644 --- a/web/src/utils/file/index.ts +++ b/web/src/utils/file/index.ts @@ -280,7 +280,7 @@ const checkName = (name: string) => { } const checkPath = (path: string) => { - return /^(?!\/)(?!.*\/$)(?!.*\/\/)(?!.*\s).*$/.test(path) + return /^(?!\/)(?!.*\/$)(?!.*\/\/).*$/.test(path) } const getFilename = (path: string) => { diff --git a/web/src/views/file/PathInput.vue b/web/src/views/file/PathInput.vue index a072e87c..2942c608 100644 --- a/web/src/views/file/PathInput.vue +++ b/web/src/views/file/PathInput.vue @@ -27,6 +27,7 @@ const handleInput = () => { } const handleBlur = () => { + input.value = input.value.replace(/(^\/)|(\/$)/g, '') if (!checkPath(input.value)) { window.$message.error('路径不合法') return