0.1.20 • Published 8 years ago

node-wechat-api v0.1.20

Weekly downloads
1
License
MIT
Repository
-
Last release
8 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

8 years ago

0.1.19

8 years ago

0.1.18

8 years ago

0.1.17

8 years ago

0.1.16

8 years ago

0.1.15

8 years ago

0.1.14

8 years ago

0.1.13

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7-test

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5-debug1

8 years ago

0.1.5-debug

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago