123456789101112131415161718192021 |
- 'use strict';
- const Controller = require('egg').Controller;
- const { CrudController } = require('naf-framework-mongoose/lib/controller');
- // 管理员
- class UserController extends Controller {
- constructor(ctx) {
- super(ctx);
- this.service = this.ctx.service.user;
- }
- async init() {
- await this.service.init();
- this.ctx.ok();
- }
- async login() {
- const data = await this.service.login(this.ctx.request.body);
- this.ctx.ok({ data });
- }
- }
- module.exports = CrudController(UserController, {});
|