@cpzxrobot/sdk 1.3.52 → 1.3.53

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/device_filter.ts CHANGED
@@ -208,12 +208,11 @@ export abstract class DeviceFilter<T extends { id: number }> {
208
208
  if (args.type == "raw") {
209
209
  return res;
210
210
  } else {
211
- if (res.data) {
212
- throw "device_list error("+JSON.stringify(res)+")";
211
+ if (!res.data) {
212
+ throw "device_list error(" + JSON.stringify(res) + ")";
213
213
  } else if (res.data.Error) {
214
214
  throw res.data.Error;
215
215
  }
216
- // this.devices.push(res.data);
217
216
  return res.data;
218
217
  }
219
218
  });
@@ -386,7 +385,9 @@ export abstract class DeviceFilter<T extends { id: number }> {
386
385
  });
387
386
  })
388
387
  .then((res) => {
389
- if (res.data.Error) {
388
+ if (!res.data) {
389
+ throw "device_list error(" + JSON.stringify(res) + ")";
390
+ } else if (res.data.Error) {
390
391
  throw res.data.Error;
391
392
  } else {
392
393
  return this.wrapList(res.data);
@@ -189,13 +189,12 @@ class DeviceFilter {
189
189
  return res;
190
190
  }
191
191
  else {
192
- if (res.data) {
192
+ if (!res.data) {
193
193
  throw "device_list error(" + JSON.stringify(res) + ")";
194
194
  }
195
195
  else if (res.data.Error) {
196
196
  throw res.data.Error;
197
197
  }
198
- // this.devices.push(res.data);
199
198
  return res.data;
200
199
  }
201
200
  });
@@ -331,7 +330,10 @@ class DeviceFilter {
331
330
  });
332
331
  })
333
332
  .then((res) => {
334
- if (res.data.Error) {
333
+ if (!res.data) {
334
+ throw "device_list error(" + JSON.stringify(res) + ")";
335
+ }
336
+ else if (res.data.Error) {
335
337
  throw res.data.Error;
336
338
  }
337
339
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.52",
3
+ "version": "1.3.53",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {