npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jushuitan

v1.0.2

Published

聚水潭非官方SDK

Downloads

39

Readme

聚水潭 jushuitan

聚水潭 Non-Official SDK for nodejs

安装

npm i jushuitan --save

快速上手

const Jushuitan = require('jushuitan');
const jushuitan = new Jushuitan({
    // 线上地址是 http://open.erp321.com/api/open/query.aspx
    url: 'http://c.sursung.com/api/open/query.aspx',
    // 合作方编号
    partnerid: 'ywv5jGT8ge6Pvlq3FZSPol345asd',
    // 接入密钥
    patrnerkey: 'ywv5jGT8ge6Pvlq3FZSPol2323',
    // 授权码
    token: '181ee8952a88f5a57db52587472c3798',
});

const method = 'shops.query';
const form = {
    nicks: [
        '[email protected]'
    ]
};
jushuitan.query(method, form)
.then(res => {
    console.log(res);
});

这里 res 输出的内容是:

{ shops:
    [ { shop_id: 82,
        shop_name: '胜商ERP软件旗舰店',
        shop_site: '京东商城',
        shop_url: 'http://shop110721021.taobao.com',
        created: '2016-04-28 09:49:58',
        nick: '[email protected]',
        session_expired: null,
        short_name: '' } ],
code: 0,
issuccess: true,
msg: null }

构造函数 new Jushuitan([config])

省略 config 时默认使用聚水潭测试环境。

config 配置项:

  • url string 接口地址
  • partnerid string 合作方编号
  • patrnerkey string 接入密钥
  • token string 授权码

查询 Jushuitan.prototype.query(method, form)

  • method string 聚水潭接口名称
  • form 业务参数

验证签名 Jushuitan.prototype.verify(url | qs)

用于同步推送接口,可以传入字符串的 url 地址,或已经解析完的 queryString。sign 正确就返回 true, 不正确就返回 false

  • url string 收到请求的接口地址
  • qs Object 收到请求的 QueryString

然而由于 partnerid 和 partnerkey 都是固定值 erp,所以此安全隐患导致无法验证请求发起者确是聚水潭官方。 http://open.jushuitan.com/document/1017.html

Todo

暂不支持奇门接口

ChangeLog

v1.0.2

  • 修复 typo partnerkey
  • 增加 verify 验证 sign 方法

v1.0.1 Add git repository v1.0.0 初始化版本