youzanyun-sdk-nodejs
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -8,6 +8,6 @@ const https = require('https'); | ||
// 从环境变量中获取 HTTP 代理的请求值 | ||
const envEnableProxy = env['youzan_proxy_enable'] === 'true'; | ||
const envProxyHost = env['youzan_proxy_host']; | ||
const envProxyToken = env['youzan_proxy_token']; | ||
const envNonProxyHosts = (env['youzan_proxy_nonProxyHosts'] || '').split(','); | ||
const envEnableProxy = env['YOUZAN_PROXY_ENABLE'] === 'true'; | ||
const envProxyHost = env['YOUZAN_PROXY_HOST']; | ||
const envProxyToken = env['YOUZAN_PROXY_TOKEN']; | ||
const envNonProxyHosts = (env['YOUZAN_PROXY_NONPROXYHOSTS'] || '').split(','); | ||
@@ -21,3 +21,3 @@ class HttpClient { | ||
rejectUnauthorized, | ||
}) { | ||
} = {}) { | ||
this.enableProxy = enableProxy; | ||
@@ -24,0 +24,0 @@ this.proxyHost = proxyHost; |
@@ -15,4 +15,4 @@ /** | ||
module.exports = { | ||
request: httpClient.request, | ||
callApi: apiClient.callApi, | ||
request: params => httpClient.request(params), | ||
callApi: params => apiClient.callApi(params), | ||
}; |
{ | ||
"name": "youzanyun-sdk-nodejs", | ||
"version": "1.0.0", | ||
"description": "有赞云免鉴权 sdk", | ||
"version": "1.1.0", | ||
"description": "有赞云 nodejs sdk", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
19
test.js
@@ -1,5 +0,16 @@ | ||
console.log(process.env.TEST_ENV); | ||
const sdk = require('./index'); | ||
setTimeout(() => { | ||
console.log(process.env.TEST_ENV); | ||
}, 10000); | ||
const main_handler = async () => { | ||
try { | ||
const res = await sdk.request({ | ||
url: 'https://open.youzanyun.com/auth/token', | ||
method: 'POST', | ||
data: {}, | ||
}); | ||
} catch (e) { | ||
console.log('rrrrrrr'); | ||
console.log(e.message); | ||
} | ||
}; | ||
main_handler(); |
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
12426
408