youzanyun-sdk-nodejs
Advanced tools
Comparing version 1.6.0 to 1.7.0
@@ -82,3 +82,3 @@ /** | ||
// 网关Api调用 | ||
async callApi({ api, version, params, files, grant_id: kdtId }) { | ||
async callApi({ api, version, params, files, grant_id: kdtId }, _axiosConfig) { | ||
let token; | ||
@@ -91,13 +91,16 @@ try { | ||
} | ||
const result = this._call({ | ||
api, | ||
version, | ||
params, | ||
token, | ||
files, | ||
}); | ||
const result = this._call( | ||
{ | ||
api, | ||
version, | ||
params, | ||
token, | ||
files, | ||
}, | ||
_axiosConfig, | ||
); | ||
return result; | ||
} | ||
async _call({ api, version, token, params, files }) { | ||
async _call({ api, version, token, params, files }, _axiosConfig) { | ||
let url = ''; | ||
@@ -112,5 +115,5 @@ if (token) { | ||
if (files && Object.keys(files).length > 0) { | ||
response = await this._requestMultipart(url, params, files); | ||
response = await this._requestMultipart(url, params, files, _axiosConfig); | ||
} else { | ||
response = await this._requestJson(url, params); | ||
response = await this._requestJson(url, params, _axiosConfig); | ||
} | ||
@@ -124,4 +127,5 @@ if (response.data.success) { | ||
async _requestJson(url, data) { | ||
async _requestJson(url, data, _axiosConfig = {}) { | ||
let response = await this._httpClient.request({ | ||
..._axiosConfig, | ||
url, | ||
@@ -137,3 +141,3 @@ method: 'post', | ||
async _requestMultipart(url, data, files) { | ||
async _requestMultipart(url, data, files, _axiosConfig = {}) { | ||
let form = new FormData(); | ||
@@ -150,2 +154,3 @@ data = data || {}; | ||
let response = await this._httpClient.request({ | ||
..._axiosConfig, | ||
url, | ||
@@ -152,0 +157,0 @@ method: 'post', |
{ | ||
"name": "youzanyun-sdk-nodejs", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "有赞云 nodejs sdk", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -27,3 +27,3 @@ process.env.OPENSDK_CLIENTID = '434bff5f1b502f9668'; | ||
files: null, | ||
grant_id: 53548965, | ||
kdtId: 53548965, | ||
}); | ||
@@ -30,0 +30,0 @@ |
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
14422
461