@axolo/egg-wechat
Version:
node-wechat plugin for Egg.js.
55 lines (38 loc) • 918 B
Markdown
```bash
npm i @axolo/egg-wechat --save
```
```js
// config/plugin.js
exports.wechat = {
enable: true,
package: '@axolo/egg-wechat',
};
```
```js
// {app_root}/config/config.default.js
exports.wechat = {};
```
请到 <https://github.com/axolo/node-wechat> 获取更多配置说明。
请到 [config/config.default.js](config/config.default.js) 查看详细配置项说明。
```js
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;
```
请到 <https://github.com/axolo/egg-wechat/issues> 异步交流。
[](LICENSE)