'use strict'; const _ = require('lodash'); const Controller = require('egg').Controller; // 用户controller class LoginController extends Controller { constructor(ctx) { super(ctx); this.service = this.ctx.service.user.login; } async login() { const data = await this.service.login(this.ctx.request.body); this.ctx.ok({ data }); } async token() { const res = await this.service.token(this.ctx.request.body); this.ctx.ok({ data: res }); } } module.exports = LoginController;