wxpay.js 567 B

1234567891011121314151617181920
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  4. // 微信支付部分
  5. class WxpayController extends Controller {
  6. constructor(ctx) {
  7. super(ctx);
  8. this.service = this.ctx.service.wxpay;
  9. }
  10. async toAuth() {
  11. const res = await this.service.toAuth(this.ctx.query);
  12. this.ctx.ok({ data: res });
  13. }
  14. async cash() {
  15. const res = await this.service.cash(this.ctx.query);
  16. this.ctx.ok({ data: res });
  17. }
  18. }
  19. module.exports = CrudController(WxpayController, {});