From a83d590d169838f985709f0deb14fb8f8409a8ca Mon Sep 17 00:00:00 2001 From: cool Date: Fri, 8 Mar 2024 17:32:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=AC=E5=9C=B0=E6=96=87?= =?UTF-8?q?=E4=BB=B6downAndUpload=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/plugin/hooks/upload/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/plugin/hooks/upload/index.ts b/src/modules/plugin/hooks/upload/index.ts index 7923585..b8b24fe 100644 --- a/src/modules/plugin/hooks/upload/index.ts +++ b/src/modules/plugin/hooks/upload/index.ts @@ -53,6 +53,10 @@ export class PluginUpload extends BasePluginHook implements BaseUpload { if (!fs.existsSync(dirPath)) { fs.mkdirSync(dirPath, { recursive: true }); } + const uuidStr = uuid(); + const name = `uploads/${moment().format('YYYYMMDD')}/${ + fileName ? fileName : uuidStr + extend + }`; fs.writeFileSync( `${dirPath}/${fileName ? fileName : uuid() + extend}`, data