eprolo-cli 1.0.52 → 1.0.54
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 +7 -4
- package/package.json +1 -1
package/bin/eprolo-cli.js
CHANGED
|
@@ -183,14 +183,17 @@ function authLogout() {
|
|
|
183
183
|
// orders query — 查询订单(带 401 自动刷新)
|
|
184
184
|
// ---------------------------------------------------------------------------
|
|
185
185
|
|
|
186
|
-
async function queryOrders() {
|
|
186
|
+
async function queryOrders(orderId) {
|
|
187
187
|
const config = readConfig();
|
|
188
188
|
if (!config.accessToken) {
|
|
189
189
|
console.error(JSON.stringify({ success: false, errorMessage: "未授权,请先登录" }));
|
|
190
190
|
process.exit(1);
|
|
191
191
|
}
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
if (!orderId) {
|
|
193
|
+
console.error(JSON.stringify({ success: false, errorMessage: "缺少订单 ID" }));
|
|
194
|
+
process.exit(1);
|
|
195
|
+
}
|
|
196
|
+
const data = await postJsonWithRetry(ORDERS_API, {id:orderId}, config);
|
|
194
197
|
console.log(JSON.stringify(data, null, 2));
|
|
195
198
|
process.exit(0);
|
|
196
199
|
}
|
|
@@ -254,7 +257,7 @@ async function main() {
|
|
|
254
257
|
}
|
|
255
258
|
|
|
256
259
|
if (argv[0] === "orders") {
|
|
257
|
-
await queryOrders();
|
|
260
|
+
await queryOrders(argv[1]);
|
|
258
261
|
return;
|
|
259
262
|
}
|
|
260
263
|
|
package/package.json
CHANGED