mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix: same url same path
This commit is contained in:
parent
cf423972ab
commit
48768c18a9
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user