新增前端vue
This commit is contained in:
15
web-vue/packages/tests/src/controller/FileController.ts
Normal file
15
web-vue/packages/tests/src/controller/FileController.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import FileService from '../service/FileService';
|
||||
import { router } from '../router';
|
||||
|
||||
const service: FileService = new FileService();
|
||||
|
||||
router.post('/menuRoute', async (ctx) => {
|
||||
const files: any = ctx.request.files.file;
|
||||
console.log(files);
|
||||
|
||||
if (files.length === undefined) {
|
||||
service.upload(ctx, files, false);
|
||||
} else {
|
||||
service.upload(ctx, files, true);
|
||||
}
|
||||
});
|
||||
8
web-vue/packages/tests/src/controller/MenuController.ts
Normal file
8
web-vue/packages/tests/src/controller/MenuController.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import MenuService from '../service/MenuService';
|
||||
import { router } from '../router';
|
||||
|
||||
const service: MenuService = new MenuService();
|
||||
|
||||
router.get('/menuRoute', async (ctx) => {
|
||||
ctx.body = await service.menuRoute(ctx);
|
||||
});
|
||||
12
web-vue/packages/tests/src/controller/UserController.ts
Normal file
12
web-vue/packages/tests/src/controller/UserController.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import UserService from '../service/UserService';
|
||||
import { router } from '../router';
|
||||
|
||||
const service: UserService = new UserService();
|
||||
|
||||
router.get('/login', async (ctx) => {
|
||||
ctx.body = await service.login(ctx);
|
||||
});
|
||||
|
||||
router.get('/index', async (ctx) => {
|
||||
ctx.body = await service.index(ctx);
|
||||
});
|
||||
Reference in New Issue
Block a user