@cpzxrobot/sdk 1.3.76 → 1.3.77

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.
@@ -33,7 +33,13 @@ class FactoryGateway extends Object {
33
33
  return __awaiter(this, void 0, void 0, function* () {
34
34
  var axios = yield this.context.ready;
35
35
  const response = yield axios.get(`/api/v1/unit/${id}`);
36
- return response.data;
36
+ const body = response.data;
37
+ if (body.code === 200) {
38
+ return body.data;
39
+ }
40
+ else {
41
+ throw new Error(body.message);
42
+ }
37
43
  });
38
44
  }
39
45
  add(factory) {
@@ -25,7 +25,12 @@ export class FactoryGateway extends Object {
25
25
  async unit(id: number): Promise<any> {
26
26
  var axios = await this.context.ready;
27
27
  const response = await axios.get(`/api/v1/unit/${id}`);
28
- return response.data;
28
+ const body = response.data;
29
+ if (body.code === 200) {
30
+ return body.data;
31
+ }else{
32
+ throw new Error(body.message);
33
+ }
29
34
  }
30
35
 
31
36
  async add(factory: Factory) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.76",
3
+ "version": "1.3.77",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {