power.js 525 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. class LoginController extends Controller {
  4. async login() {
  5. const { ctx } = this;
  6. const res = await ctx.service.power.login(ctx.request.body);
  7. ctx.body = res;
  8. }
  9. async getUserMenu() {
  10. const { ctx } = this;
  11. const res = await ctx.service.power.getUserMenu();
  12. ctx.body = res;
  13. }
  14. async captcha() {
  15. const { ctx } = this;
  16. const res = await ctx.service.power.captcha();
  17. ctx.body = res;
  18. }
  19. }
  20. module.exports = LoginController;