https://github.com/zhaotoday/mp-server
Server-side utilities for mini-program.小程序服务端工具库。
https://github.com/zhaotoday/mp-server
Last synced: 7 months ago
JSON representation
Server-side utilities for mini-program.小程序服务端工具库。
- Host: GitHub
- URL: https://github.com/zhaotoday/mp-server
- Owner: zhaotoday
- Created: 2018-06-01T10:28:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-25T16:23:54.000Z (over 3 years ago)
- Last Synced: 2025-03-11T17:11:10.762Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 使用
安装
```bash
$ npm install --save mp-server
```初始化
```js
const mp = require('mp-server')
const auth = new mp.Auth({ appid, secret })
```## 模块
Auth
```js
const codeToSessionRes = await auth.codeToSession({ code })
const decryptedData = auth.decryptData({
sessionKey,
encryptedData,
iv
})
```