mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 08:36:19 +08:00
perf: Refactor vite configuration
This commit is contained in:
18
apps/test-server/controller/FileController.ts
Normal file
18
apps/test-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();
|
15
apps/test-server/controller/UserController.ts
Normal file
15
apps/test-server/controller/UserController.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import UserService from '../service/UserService';
|
||||
|
||||
class UserController {
|
||||
private service: UserService = new UserService();
|
||||
|
||||
login = async (ctx) => {
|
||||
ctx.body = await this.service.login();
|
||||
};
|
||||
|
||||
getUserInfoById = async (ctx) => {
|
||||
ctx.body = await this.service.getUserInfoById();
|
||||
};
|
||||
}
|
||||
|
||||
export default new UserController();
|
Reference in New Issue
Block a user