util.js 368 B

12345678910111213141516
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. class UtilController extends Controller {
  4. async index() {
  5. const { ctx } = this;
  6. ctx.body = 'hi, egg';
  7. }
  8. async utilMethod() {
  9. const res = await this.ctx.service.util.utilMethod(this.ctx.query, this.ctx.request.body);
  10. this.ctx.ok({ data: res });
  11. }
  12. }
  13. module.exports = UtilController;