@axolo/egg-wechat
v0.0.2
Published
node-wechat plugin for Egg.js.
Downloads
8
Maintainers
Readme
egg-wechat
node-wechat plugin for Egg.js.
Install
npm i @axolo/egg-wechat --save
Usage
// {app_root}/config/plugin.js
exports.wechat = {
enable: true,
package: '@axolo/egg-wechat',
};
Configuration
// {app_root}/config/config.default.js
exports.wechat = {};
see https://github.com/axolo/node-wechat for more help. see config/config.default.js for more detail.
Example
const Controller = require('egg').Controller;
class WechatController extends Controller {
async index() {
const { app, ctx } = this;
const { wechat } = app;
const params = { openid: 'openid' };
const result = await wechat.execute('/user/info', { params });
ctx.body = result;
}
}
module.exports = WechatController;
Questions & Suggestions
Please open an issue here.