hupun-open-api-nodejs-sdk
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -71,3 +71,3 @@ import axios from 'axios'; | ||
function HupunClient(config) { | ||
this.url = "https://open-api.hupun.com/api"; | ||
this.url = 'https://open-api.hupun.com/api'; | ||
this.appkey = config.appkey; | ||
@@ -90,2 +90,9 @@ this.appsecret = config.appsecret; | ||
var paramsToSign = __assign(__assign({}, params), { _app: this.appkey }); | ||
// 检查下所有参数,如果是object的,转化成jsonstring | ||
for (var _i = 0, _a = Object.keys(paramsToSign); _i < _a.length; _i++) { | ||
var k = _a[_i]; | ||
if (typeof paramsToSign[k] === 'object') { | ||
paramsToSign[k] = JSON.stringify(paramsToSign[k]); | ||
} | ||
} | ||
var stringToSign = this.appsecret + queryString.stringify(paramsToSign) + this.appsecret; | ||
@@ -92,0 +99,0 @@ return stringToSign; |
@@ -81,3 +81,3 @@ 'use strict'; | ||
function HupunClient(config) { | ||
this.url = "https://open-api.hupun.com/api"; | ||
this.url = 'https://open-api.hupun.com/api'; | ||
this.appkey = config.appkey; | ||
@@ -100,2 +100,9 @@ this.appsecret = config.appsecret; | ||
var paramsToSign = __assign(__assign({}, params), { _app: this.appkey }); | ||
// 检查下所有参数,如果是object的,转化成jsonstring | ||
for (var _i = 0, _a = Object.keys(paramsToSign); _i < _a.length; _i++) { | ||
var k = _a[_i]; | ||
if (typeof paramsToSign[k] === 'object') { | ||
paramsToSign[k] = JSON.stringify(paramsToSign[k]); | ||
} | ||
} | ||
var stringToSign = this.appsecret + queryString__default['default'].stringify(paramsToSign) + this.appsecret; | ||
@@ -102,0 +109,0 @@ return stringToSign; |
{ | ||
"name": "hupun-open-api-nodejs-sdk", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "对接万里牛ERP开放接口的NodeJS SDK", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -30,4 +30,8 @@ # hupun-open-api-nodejs-sdk | ||
.catch((e) => { | ||
console.error(e.message); | ||
if (e.response) { | ||
console.error(e.response.data); | ||
} else { | ||
console.error(e.message); | ||
} | ||
}); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13119
220
37