zs vor 1 Jahr
Ursprung
Commit
0e206889f0
2 geänderte Dateien mit 1 neuen und 7 gelöschten Zeilen
  1. 0 3
      src/controller/file.controller.ts
  2. 1 4
      src/service/file.service.ts

+ 0 - 3
src/controller/file.controller.ts

@@ -5,9 +5,6 @@ export class FileController {
   @Inject()
   service: FileService;
 
-  @Inject()
-  ctx;
-
   @Post('/upload')
   async upload(@Files() files, @Fields() fields) {
     const result = await this.service.upload(files, fields);

+ 1 - 4
src/service/file.service.ts

@@ -1,4 +1,4 @@
-import { Provide, Inject } from '@midwayjs/decorator';
+import { Provide } from '@midwayjs/decorator';
 import { Config } from '@midwayjs/core';
 import { FrameworkErrorEnum, ServiceError } from 'free-midway-component';
 import * as fs from 'node:fs';
@@ -14,9 +14,6 @@ export class FileService {
   @Config('export.file_type')
   file_type;
 
-  @Inject()
-  ctx;
-
   async upload(files, fields) {
     const path = `${this.root_path}${sep}${this.file_type}`;
     if (!path) {