# wxchat-nodejs-sdk

> ## 功能点 * H5微信登陆 * jssdk 初始化 * 微信图片上传 * 微信支付 * 分享

Latest version **1.0.2** (published 2019-07-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install wxchat-nodejs-sdk
pnpm add wxchat-nodejs-sdk
yarn add wxchat-nodejs-sdk
bun add wxchat-nodejs-sdk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-07-23 |
| First published | 2019-07-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 55.9 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | lihuazhai |

## Links

- npm: https://www.npmjs.com/package/wxchat-nodejs-sdk
- Repository: https://github.com/lihuazhai/wxchat-lib
- Homepage: https://github.com/lihuazhai/wxchat-lib#readme
- Issues: https://github.com/lihuazhai/wxchat-lib/issues
- npm.io page: https://npm.io/package/wxchat-nodejs-sdk

## Dependencies (7)

- [sha1](https://npm.io/package/sha1.md) ^1.1.1
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.19
- [request](https://npm.io/package/request.md) ^2.88.0
- [node-sha1](https://npm.io/package/node-sha1.md) ^1.0.1
- [xmlreader](https://npm.io/package/xmlreader.md) ^0.2.3
- [querystring](https://npm.io/package/querystring.md) ^0.2.0
- [memory-cache](https://npm.io/package/memory-cache.md) ^0.2.0

## Recent versions

- 1.0.2 (latest) — 2019-07-23
- 1.0.1 — 2019-07-18
- 1.0.0 — 2019-07-18

## README

# 微信开发 nodejs SDK（开发工具包）

一个基于nodejs服务的快速开发工具库，提供了微信open api接口的封装.
申请地址：https://mp.weixin.qq.com/ 

## 依赖 jest 

## 功能
* <s>jssdk 初始化</s>

* <s>H5页面微信拍照，图片上传</s>

* H5页面微信登陆 

* H5页面微信支付

* 微信分享

## 效果演示

> H5页面调用微信jssdk,实现拍照，选择相册的图片,用微信扫描打开

![wxchatSdkDemo](http://www.lihuazhai.com/public/wxchatSdkDemo.jpg)

## 组件使用

1、组件安装
> npm i -S wxchat-nodejs-sdk

2、数组引入

```javascript
const WxchatSdk = require('wxchat-nodejs-sdk');
const wxSdk = new WxchatSdk(AppID,AppSecret);
//AppID,AppSecret替换为自己申请得到的值
```
3、获取签名
```javascript
router.get('/getSign', async function (ctx, next) {
    let pageUrl = ctx.query.url;
    try {
        let pageUrl = ctx.query.url;
        const res = await wxSdk.getSign(pageUrl);
        ctx.response.type = 'json';
        ctx.body = { "succee": true, content: { ...res } };
    } catch (e) {
        ctx.response.type = 'json';
        ctx.body = { "succee": false, "msg": "获取是失败" };
    }
});
```

> 注意：pageUrl 是当前前端页面的url,（如：zhuan.lihuazhai.com/buy/ ）,非请求的API接口。

## 联系我们

>如遇到使用问题，或是有其他功能需求，可以联系我们。QQ群：28861454，加时备注"微信sdk"。

![QQjishuQun](http://www.lihuazhai.com/public/QQjishuQun.png)

---
_Source: https://npm.io/package/wxchat-nodejs-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
