home.js 343 B

1234567891011121314151617
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. class HomeController extends Controller {
  4. async index() {
  5. const { ctx } = this;
  6. ctx.body = 'hi, egg';
  7. }
  8. async qrcode() {
  9. const data = await this.ctx.service.qrcode.create(this.ctx.request.body);
  10. this.ctx.ok({ data });
  11. }
  12. }
  13. module.exports = HomeController;