eprolo-cli 1.0.70 → 1.0.71
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/bin/eprolo-cli.js +5 -1
- package/package.json +1 -1
package/bin/eprolo-cli.js
CHANGED
|
@@ -45,6 +45,10 @@ function readFlag(argv, flag) {
|
|
|
45
45
|
// ---------------------------------------------------------------------------
|
|
46
46
|
|
|
47
47
|
function postJson(url, body, headers = {},method = "POST") {
|
|
48
|
+
if(method == "GET") {
|
|
49
|
+
url += "?" + new URLSearchParams(body).toString();
|
|
50
|
+
body = {};
|
|
51
|
+
}
|
|
48
52
|
return new Promise((resolve, reject) => {
|
|
49
53
|
const target = new URL(url);
|
|
50
54
|
const payload = JSON.stringify(body);
|
|
@@ -198,7 +202,7 @@ async function queryOrders(orderId) {
|
|
|
198
202
|
console.error(JSON.stringify({ success: false, errorMessage: "缺少订单 ID" }));
|
|
199
203
|
process.exit(1);
|
|
200
204
|
}
|
|
201
|
-
const data = await postJsonWithRetry(ORDERS_API, {
|
|
205
|
+
const data = await postJsonWithRetry(ORDERS_API, {timestamp:config.timestamp,sign:config.accessToken}, config, "GET");
|
|
202
206
|
console.log(JSON.stringify(data, null, 2));
|
|
203
207
|
process.exit(0);
|
|
204
208
|
}
|
package/package.json
CHANGED