2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

fix: 文件名称检查支持中文

This commit is contained in:
耗子
2024-11-26 01:18:08 +08:00
parent a8575bcda9
commit 7aca6587af
3 changed files with 8 additions and 4 deletions

View File

@@ -276,7 +276,7 @@ const languageByPath = (path: string) => {
}
const checkName = (name: string) => {
return /^[a-zA-Z0-9_.@#$%\-\s[\]()]+$/.test(name)
return /^[\p{L}\p{N}\p{P}\s]+$/u.test(name)
}
const checkPath = (path: string) => {

View File

@@ -1,5 +1,9 @@
<script setup lang="ts"></script>
<template></template>
<template>
<div>
<h1>UserList</h1>
</div>
</template>
<style scoped lang="scss"></style>

View File

@@ -37,8 +37,8 @@ const uploadRequest = ({ file, onFinish, onError, onProgress }: UploadCustomRequ
<n-alert type="info">若上传报网络错误请开启面板 HTTPS 后重试</n-alert>
<n-upload
ref="upload"
directory-dnd
multiple
multiple directory-dnd
action="/api/panel/file/upload"
:custom-request="uploadRequest"
>