mirror of
https://github.com/acepanel/panel.git
synced 2026-02-05 06:57:19 +08:00
feat: 优化目录输入自动清理多余的斜杠和空格
This commit is contained in:
@@ -280,7 +280,7 @@ const checkName = (name: string) => {
|
||||
}
|
||||
|
||||
const checkPath = (path: string) => {
|
||||
return /^(?!\/)(?!.*\/$)(?!.*\/\/)(?!.*\s).*$/.test(path)
|
||||
return /^(?!\/)(?!.*\/$)(?!.*\/\/).*$/.test(path)
|
||||
}
|
||||
|
||||
const getFilename = (path: string) => {
|
||||
|
||||
@@ -27,6 +27,7 @@ const handleInput = () => {
|
||||
}
|
||||
|
||||
const handleBlur = () => {
|
||||
input.value = input.value.replace(/(^\/)|(\/$)/g, '')
|
||||
if (!checkPath(input.value)) {
|
||||
window.$message.error('路径不合法')
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user