2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-05 06:57:19 +08:00

feat: 优化目录输入自动清理多余的斜杠和空格

This commit is contained in:
耗子
2024-11-11 00:47:09 +08:00
parent ecadaa9bbc
commit b08eb6bf1f
2 changed files with 2 additions and 1 deletions

View File

@@ -280,7 +280,7 @@ const checkName = (name: string) => {
}
const checkPath = (path: string) => {
return /^(?!\/)(?!.*\/$)(?!.*\/\/)(?!.*\s).*$/.test(path)
return /^(?!\/)(?!.*\/$)(?!.*\/\/).*$/.test(path)
}
const getFilename = (path: string) => {

View File

@@ -27,6 +27,7 @@ const handleInput = () => {
}
const handleBlur = () => {
input.value = input.value.replace(/(^\/)|(\/$)/g, '')
if (!checkPath(input.value)) {
window.$message.error('路径不合法')
return