zs hace 1 año
padre
commit
2f9745a0c2

+ 1 - 1
src/config/config.default.ts

@@ -2,7 +2,7 @@ import { MidwayConfig } from '@midwayjs/core';
 import { uploadWhiteList } from '@midwayjs/upload';
 import { tmpdir } from 'os';
 import { join } from 'path';
-const project = 'fileup';
+const project = 'file';
 export default {
   // use for cookie sign key, should change to your own and keep security
   keys: '1672292154640_488',

+ 1 - 1
src/config/config.local.ts

@@ -1,6 +1,6 @@
 import { MidwayConfig } from '@midwayjs/core';
 const ip = '127.0.0.1';
-const project = 'fileup';
+const project = 'file';
 const mongodb = 'file-upload_v1';
 export default {
   // use for cookie sign key, should change to your own and keep security

+ 1 - 1
src/config/config.prod.ts

@@ -1,6 +1,6 @@
 import { MidwayConfig } from '@midwayjs/core';
 const ip = '127.0.0.1';
-const project = 'fileup';
+const project = 'file';
 const mongodb = 'file-upload_v1';
 export default {
   // use for cookie sign key, should change to your own and keep security

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

@@ -2,7 +2,7 @@ import { Controller, Inject, Post, Files, Fields } from '@midwayjs/core';
 import { FileService } from '../service/file.service';
 import { Context } from '@midwayjs/koa';
 
-@Controller('/fileup')
+@Controller()
 export class FileController {
   @Inject()
   service: FileService;

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

@@ -48,7 +48,7 @@ export class FileService {
       await sharp(val.data)
         .toFormat('jpg', { mozjpeg: true })
         .toFile(`${filePath}${filename}.jpg`);
-      const uri = `/fileup/${dirs.join('/')}/${filename}.jpg`;
+      const uri = `/file/${dirs.join('/')}/${filename}.jpg`;
       return {
         id: filename,
         name: `${filename}.jpg`,