0.1.17 • Published 2 years ago
strapi-middleware-wxopen v0.1.17
Usage
koa
import Koa from "koa";
import wxComponentService from "wx-component-service";
const app = new Koa();
wxComponentService(
app,
// weixin component config
{
componentAppSecret: "****",
componentAppId: "****",
token: "****",
encodingAESKey: "****",
},
// redis config
{
host: "your_redis_host",
port: 6379,
db: 20,
password: "****",
}
);
// registe route for revicing component_ticket
import KoaRouter from "koa-router";
const router = new KoaRouter();
router.post("/notify", async (ctx, next) => {
const wxc = ctx.wxc;
const ticket = await wxc.decodeTicket(ctx.request.xml);
console.log(ticket);
ctx.body = "success";
});
app.use(router.routes());
app.listen(8008);
0.1.12
2 years ago
0.1.13
2 years ago
0.1.14
2 years ago
0.1.15
2 years ago
0.1.16
2 years ago
0.1.17
2 years ago
0.1.10
2 years ago
0.1.11
2 years ago
0.1.9
3 years ago
0.1.8
3 years ago
0.1.7
3 years ago
0.1.0
3 years ago
0.1.2
3 years ago
0.1.1
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.1.4
3 years ago
0.1.3
3 years ago
0.1.6
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago