eprolo-cli 1.0.61 → 1.0.63

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 CHANGED
@@ -90,7 +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
- if (result.data.code === 400) {
93
+ if (result.data.code == 400) {
94
94
  // 刷新 token
95
95
  const refreshRes = await postJson(REFRESH_API, {},{
96
96
  refreshToken: config.refreshToken
@@ -110,7 +110,7 @@ async function postJsonWithRetry(url, body, config) {
110
110
  err.response = refreshRes.data;
111
111
  throw err;
112
112
  }
113
- }else if (result.statusCode !== 200) {
113
+ }else if (result.data.code != 200) {
114
114
  const err = new Error(`HTTP ${result.statusCode}`);
115
115
  err.response = 6666;
116
116
  throw err;
@@ -129,12 +129,12 @@ async function login(argv) {
129
129
 
130
130
  const res = await postJson(LOGIN_API, { openApiKey: userCode });
131
131
 
132
- if (res.code !== 0) {
132
+ if (res.data.code !== 0) {
133
133
  console.error(JSON.stringify({
134
134
  success: false,
135
135
  errorMessage: res.error || "登录失败",
136
136
  statusCode: res.code,
137
- response: res.data
137
+ response: res.data.msg
138
138
  }));
139
139
  process.exit(1);
140
140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eprolo-cli",
3
- "version": "1.0.61",
3
+ "version": "1.0.63",
4
4
  "description": "CLI for Dianxiaobao ICBU AI publishing, authorization profile management, task submission, and task status checks.",
5
5
  "bin": {
6
6
  "eprolo": "bin/eprolo-cli.js"