0.1.20 • Published 10 years ago

node-wechat-api v0.1.20

Weekly downloads
1
License
MIT
Repository
-
Last release
10 years ago

微信 API 集合

开放平台

import express from 'express'

const app = express()
app.listen(3000)

const weChat = new WeChat(appId, appSecret, {
    token        : 'token',       // 公众号消息校验Token
    symmetricKey : 'symmetricKey' // 公众号消息加解密Key
})

app.post('/event', weChat.event()) // 需要与 授权事件接收URL 匹配
app.get('/auth', weChat.authenticate({
    callbackURL: 'http://example.com/auth/callback'     // 微信授权回跳链接
}))
app.get('/auth/callback', weChat.authenticate())        // 微信授权回跳链接
app.get('/app/:id/auth', weChat.appAuthenticate({
    callbackURL: (req) => `http://example.com/app/${req.params.id}/callback`
}))
app.get('/app/:id/callback', weChat.appAuthenticate({}, (err, req, res, next, data) => {
    res.json(data)
}))
app.get('/app/:id/js', weChat.js())

公众平台

import express from 'express'

const app = express()
app.listen(3000)
const weChatApp = new WeChatApp(appId, appSecret)

app.get('/auth', weChatApp.authenticate({
    callbackURL: 'http://example.com/auth/callback'
}))
app.get('/auth/callback', weChatApp.authenticate({}, (err, req, res, next, data) => {
    res.json(data)
}))
app.get('/js', weChatApp.js())  // 微信 jsAPI
0.1.20

10 years ago

0.1.19

10 years ago

0.1.18

10 years ago

0.1.17

10 years ago

0.1.16

10 years ago

0.1.15

10 years ago

0.1.14

10 years ago

0.1.13

10 years ago

0.1.12

10 years ago

0.1.11

10 years ago

0.1.10

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7-test

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5-debug1

10 years ago

0.1.5-debug

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago