mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-01-24 12:20:18 +08:00
19 lines
415 B
TypeScript
19 lines
415 B
TypeScript
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();
|