@be-link/ecommerce-store-service-node-sdk 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/modules/store/types.d.ts +1 -0
- package/package.json +1 -1
- package/utils/http.js +15 -20
package/modules/store/types.d.ts
CHANGED
package/package.json
CHANGED
package/utils/http.js
CHANGED
|
@@ -89,24 +89,19 @@ async function callApi(url, request) {
|
|
|
89
89
|
const beLinkUserId = ctx?.get('beLinkUserId') || '';
|
|
90
90
|
const pandoraRoleId = ctx?.get('pandoraRoleId') || '';
|
|
91
91
|
const realIp = ctx?.get('realIp') || '';
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return responseData.data;
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
throw error;
|
|
111
|
-
}
|
|
92
|
+
const response = await axios_1.default.post(url, request || {}, {
|
|
93
|
+
headers: {
|
|
94
|
+
'x-request-id': requestId,
|
|
95
|
+
'x-belink-pandora-userid': pandoraUserId,
|
|
96
|
+
'x-belink-userid': beLinkUserId,
|
|
97
|
+
'x-belink-pandora-roleid': pandoraRoleId,
|
|
98
|
+
'x-real-ip': realIp,
|
|
99
|
+
Connection: 'keep-alive',
|
|
100
|
+
},
|
|
101
|
+
timeout: HTTP_CONFIG.requestTimeout,
|
|
102
|
+
httpAgent,
|
|
103
|
+
httpsAgent,
|
|
104
|
+
});
|
|
105
|
+
const responseData = response.data;
|
|
106
|
+
return responseData.data;
|
|
112
107
|
}
|