Skip to content

Commit 9c3394c

Browse files
committed
fix: file trash
Signed-off-by: Innei <i@innei.in>
1 parent 62243e8 commit 9c3394c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apps/core/src/modules/file/file.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import {
1010
NotFoundException,
1111
} from '@nestjs/common'
1212

13-
import { DATA_DIR, STATIC_FILE_DIR } from '~/constants/path.constant'
13+
import {
14+
STATIC_FILE_DIR,
15+
STATIC_FILE_TRASH_DIR,
16+
} from '~/constants/path.constant'
1417

1518
import { ConfigsService } from '../configs/configs.service'
1619

@@ -76,7 +79,7 @@ export class FileService {
7679
try {
7780
const path = this.resolveFilePath(type, name)
7881

79-
await fs.rename(path, resolve(DATA_DIR, 'trash', name))
82+
await fs.rename(path, resolve(STATIC_FILE_TRASH_DIR, name))
8083
} catch (e) {
8184
this.logger.error('删除文件失败', e)
8285
return null

0 commit comments

Comments
 (0)