@@ -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,6 +1,6 @@
import { MidwayConfig } from '@midwayjs/core';
const ip = '127.0.0.1';
const mongodb = 'file-upload_v1';
@@ -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;
@@ -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`,