feat: url批量上传去重&不限制下载

This commit is contained in:
chaos-zhu committed 2025-12-17 00:29:51 +08:00
1 parent 7f1d68882e
commit d8700e7944
1 file changed
+2 -11
+2 -11
View File
@@ -183,17 +183,8 @@ export default defineEventHandler(async (event) => {
})
}
// 限制URL数量,避免滥用
const maxUrls = 20
if (urls.length > maxUrls) {
throw createError({
statusCode: 400,
message: `最多支持 ${maxUrls} 个URL`
})
}
// 过滤空URL
const validUrls = urls.map(u => u.trim()).filter(u => u.length > 0)
// 过滤空URL并自动去重
const validUrls = [...new Set(urls.map(u => u.trim()).filter(u => u.length > 0))]
if (validUrls.length === 0) {
throw createError({
statusCode: 400,