eprolo-cli 1.0.117 → 1.0.119
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 +8 -6
- package/package.json +1 -1
package/bin/eprolo-cli.js
CHANGED
|
@@ -47,8 +47,10 @@ function readFlag(argv, flag) {
|
|
|
47
47
|
function postJson(url, body, headers = {}, method = "POST") {
|
|
48
48
|
const config = readConfig();
|
|
49
49
|
let signValue = {}
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
if (config.timestamp) {
|
|
51
|
+
signValue.timestamp = config.timestamp;
|
|
52
|
+
signValue.sign = config.accessToken;
|
|
53
|
+
}
|
|
52
54
|
if (method == "GET") {
|
|
53
55
|
signValue = { ...signValue, ...body };
|
|
54
56
|
}
|
|
@@ -187,13 +189,13 @@ async function queryOrders(orderId) {
|
|
|
187
189
|
console.error(JSON.stringify({ success: false, errorMessage: "缺少订单 ID" }));
|
|
188
190
|
process.exit(1);
|
|
189
191
|
}
|
|
190
|
-
const data = await postJsonWithRetry(BASE_URL+"/order.html
|
|
192
|
+
const data = await postJsonWithRetry(BASE_URL+"/order.html", {page_index: 0, page_size: 1, order_id: orderId}, config, "GET");
|
|
191
193
|
console.log(JSON.stringify(data, null, 2));
|
|
192
194
|
process.exit(0);
|
|
193
195
|
}
|
|
194
196
|
async function queryOrderList() {
|
|
195
197
|
const config = readConfig();
|
|
196
|
-
const data = await postJsonWithRetry(BASE_URL+"/order_list.html
|
|
198
|
+
const data = await postJsonWithRetry(BASE_URL+"/order_list.html", {page_index: 0, page_size: 10}, config, "GET");
|
|
197
199
|
console.log(JSON.stringify(data, null, 2));
|
|
198
200
|
process.exit(0);
|
|
199
201
|
}
|
|
@@ -203,13 +205,13 @@ async function queryProductId(productId) {
|
|
|
203
205
|
console.error(JSON.stringify({ success: false, errorMessage: "缺少产品 ID" }));
|
|
204
206
|
process.exit(1);
|
|
205
207
|
}
|
|
206
|
-
const data = await postJsonWithRetry(BASE_URL+"/getproduct.html
|
|
208
|
+
const data = await postJsonWithRetry(BASE_URL+"/getproduct.html", {id: productId}, config, "GET");
|
|
207
209
|
console.log(JSON.stringify(data, null, 2));
|
|
208
210
|
process.exit(0);
|
|
209
211
|
}
|
|
210
212
|
async function queryProductList() {
|
|
211
213
|
const config = readConfig();
|
|
212
|
-
const data = await postJsonWithRetry(BASE_URL+"/product_list.html
|
|
214
|
+
const data = await postJsonWithRetry(BASE_URL+"/product_list.html", {page_index: 0, page_size: 10}, config, "GET");
|
|
213
215
|
console.log(JSON.stringify(data, null, 2));
|
|
214
216
|
process.exit(0);
|
|
215
217
|
}
|
package/package.json
CHANGED