Explorar o código

文件读取bug

lrf hai 1 ano
pai
achega
5a68819dc8
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/controller/file.controller.ts

+ 1 - 1
src/controller/file.controller.ts

@@ -57,7 +57,7 @@ export class FileController {
   @Get('/files/*')
   async readFile() {
     const shortRealPath = this.fileService.getFileShortRealPath();
-    const realPath = join(process.cwd(), this.uploadDir, shortRealPath);
+    const realPath = join(this.uploadDir, shortRealPath);
     this.ctx.body = createReadStream(realPath);
     this.ctx.response.set('content-type', `/files/${getType(realPath)}`);
   }