1234567891011121314151617181920212223242526272829303132333435363738 |
- 'use strict';
- const _ = require('lodash');
- const Controller = require('egg').Controller;
- // 登录管理
- class LoginController extends Controller {
- constructor(ctx) {
- super(ctx);
- this.service = this.ctx.service.login;
- }
- async login() {
- const res = await this.service.login(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- async wxlogin() {
- const res = await this.service.wxlogin(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- // POST 生成二维码
- async qrcode() {
- const res = await this.service.createQrcode();
- this.ctx.ok({ data: res });
- }
- // POST 检查二维码
- async wxcheck() {
- const res = await this.service.wxcheck(this.ctx.request.body);
- this.ctx.ok(res);
- }
- }
- module.exports = LoginController;
|