From 9c3394c6c8b31538fbb780966f65173574c146a2 Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 25 Apr 2024 11:31:56 +0800 Subject: [PATCH] fix: file trash Signed-off-by: Innei --- apps/core/src/modules/file/file.service.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/core/src/modules/file/file.service.ts b/apps/core/src/modules/file/file.service.ts index 8472ec9b..8645fdd9 100644 --- a/apps/core/src/modules/file/file.service.ts +++ b/apps/core/src/modules/file/file.service.ts @@ -10,7 +10,10 @@ import { NotFoundException, } from '@nestjs/common' -import { DATA_DIR, STATIC_FILE_DIR } from '~/constants/path.constant' +import { + STATIC_FILE_DIR, + STATIC_FILE_TRASH_DIR, +} from '~/constants/path.constant' import { ConfigsService } from '../configs/configs.service' @@ -76,7 +79,7 @@ export class FileService { try { const path = this.resolveFilePath(type, name) - await fs.rename(path, resolve(DATA_DIR, 'trash', name)) + await fs.rename(path, resolve(STATIC_FILE_TRASH_DIR, name)) } catch (e) { this.logger.error('删除文件失败', e) return null