12345678910111213141516171819202122232425 |
- 'use strict';
- const Controller = require('egg').Controller;
- const { CrudController } = require('naf-framework-mongoose/lib/controller');
- class WeixinController extends Controller {
- constructor(ctx) {
- super(ctx);
- this.service = this.ctx.service.weixin;
- }
- async auth() {
- await this.service.auth(this.ctx.params, this.ctx.query);
- }
- async authBack() {
- await this.service.authBack(this.ctx.query);
- }
- async wxUser() {
- const data = await this.service.wxUser(this.ctx.params, this.ctx.query);
- this.ctx.ok({ data });
- }
- async jsapiAuth() {
- const res = await this.service.jsapiAuth(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- }
- module.exports = CrudController(WeixinController, {});
|