123456789101112131415161718192021222324252627282930313233343536373839 |
- '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 check() {
- const { qrcode } = this.ctx.requestparam;
- const res = await this.service.checkQrcode(qrcode);
- this.ctx.ok(res);
- }
- }
- module.exports = LoginController;
|