eprolo-cli 1.0.59 → 1.0.61
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 +3 -6
- package/package.json +1 -1
package/bin/eprolo-cli.js
CHANGED
|
@@ -90,10 +90,7 @@ async function postJsonWithRetry(url, body, config) {
|
|
|
90
90
|
if (config.accessToken) headers["accessToken"] = `${config.accessToken}`;
|
|
91
91
|
|
|
92
92
|
let result = await postJson(url, body, headers);
|
|
93
|
-
|
|
94
|
-
err.response = result.data;
|
|
95
|
-
throw err;
|
|
96
|
-
if (result.code === 400) {
|
|
93
|
+
if (result.data.code === 400) {
|
|
97
94
|
// 刷新 token
|
|
98
95
|
const refreshRes = await postJson(REFRESH_API, {},{
|
|
99
96
|
refreshToken: config.refreshToken
|
|
@@ -113,9 +110,9 @@ async function postJsonWithRetry(url, body, config) {
|
|
|
113
110
|
err.response = refreshRes.data;
|
|
114
111
|
throw err;
|
|
115
112
|
}
|
|
116
|
-
}else if (result.
|
|
113
|
+
}else if (result.statusCode !== 200) {
|
|
117
114
|
const err = new Error(`HTTP ${result.statusCode}`);
|
|
118
|
-
err.response =
|
|
115
|
+
err.response = 6666;
|
|
119
116
|
throw err;
|
|
120
117
|
}
|
|
121
118
|
|
package/package.json
CHANGED