mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
前端和后端源码,合并到一个git仓库中,方便用户下载,避免前后端不匹配的问题
This commit is contained in:
18
jeecgboot-vue3/tests/server/controller/FileController.ts
Normal file
18
jeecgboot-vue3/tests/server/controller/FileController.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import FileService from '../service/FileService';
|
||||
|
||||
class FileController {
|
||||
private service: FileService = new FileService();
|
||||
|
||||
upload = async (ctx) => {
|
||||
const files = ctx.request.files.file;
|
||||
console.log(files);
|
||||
|
||||
if (files.length === undefined) {
|
||||
this.service.upload(ctx, files, false);
|
||||
} else {
|
||||
this.service.upload(ctx, files, true);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default new FileController();
|
||||
Reference in New Issue
Block a user