fix: same url same path

This commit is contained in:
linyuchen 2024-03-05 08:33:23 +08:00
parent cf423972ab
commit 48768c18a9

View File

@ -40,7 +40,7 @@ export async function uri2local(uri: string, fileName: string = null) {
let buffer = await blob.arrayBuffer();
try {
fileName = path.parse(url.pathname).name || fileName
filePath = path.join(CONFIG_DIR, fileName)
filePath = path.join(CONFIG_DIR, uuidv4() + fileName)
await fs.writeFile(filePath, Buffer.from(buffer));
} catch (e: any) {
res.errMsg = `${url}下载失败,` + e.toString()