think-jsonrpc
## Install
Last updated 4 years ago by vipwanglei .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install think-jsonrpc 
SYNC missed versions from official npm registry.

think-jsonrpc

Install

npm install think-jsonrpc

How to use

配置:src/common/config/config.js

jsonrpc: {
        url: "http://192.168.20.30:8080/json.rpc",
        appName: "trade_control",
        serviceName: "trade_service",
        filter: function (reqObj) { //过滤处理请求参数,此属性可省略
            reqObj.headers.userid = 0; //获取userid代码
            return reqObj;
        }
    }

使用

let data = await jsonrpc.call("xxx", "xxx", 1, 1, 2); //jsonrpc.call("类别名","方法名",...方法使用的参数)
console.log(data.body);

LICENSE

MIT

Current Tags

  • 1.1.2                                ...           latest (4 years ago)

12 Versions

  • 1.1.2                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.9                                ...           4 years ago
  • 1.0.8                                ...           4 years ago
  • 1.0.7                                ...           4 years ago
  • 1.0.6                                ...           4 years ago
  • 1.0.5                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |