companyuser.js 798 B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. const _ = require('lodash');
  3. const meta = require('./.companyuser.js');
  4. const Controller = require('egg').Controller;
  5. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  6. // 管理
  7. class CompanyuserController extends Controller {
  8. constructor(ctx) {
  9. super(ctx);
  10. this.service = this.ctx.service.companyuser;
  11. }
  12. async login() {
  13. const res = await this.service.login(this.ctx.request.body);
  14. this.ctx.ok({ data: res });
  15. }
  16. async uppasswd() {
  17. const res = await this.service.uppasswd(this.ctx.request.body);
  18. this.ctx.ok({ data: res });
  19. }
  20. async unpasswd() {
  21. const res = await this.service.unpasswd(this.ctx.request.body);
  22. this.ctx.ok({ data: res });
  23. }
  24. }
  25. module.exports = CrudController(CompanyuserController, meta);