admin.js 583 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. const meta = require('./config/.admin.js');
  3. const Controller = require('egg').Controller;
  4. const { CrudController } = require('naf-framework-mongoose-free/lib/controller');
  5. //
  6. class AdminController extends Controller {
  7. constructor(ctx) {
  8. super(ctx);
  9. this.service = this.ctx.service.admin;
  10. }
  11. async wxAppLogin() {
  12. await this.service.wxAppLogin(this.ctx.request.body);
  13. this.ctx.ok();
  14. }
  15. async wxAppBind() {
  16. await this.service.wxAppBind(this.ctx.request.body);
  17. this.ctx.ok();
  18. }
  19. }
  20. module.exports = CrudController(AdminController, meta);