12345678910111213141516171819202122 |
- 'use strict';
- const _ = require('lodash');
- const meta = require('./.user.js');
- 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 login() {
- const res = await this.service.login(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- }
- module.exports = CrudController(UserController, meta);
|