@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.
- package/dist/factory_gateway.js +7 -1
- package/factory_gateway.ts +6 -1
- package/package.json +1 -1
package/dist/factory_gateway.js
CHANGED
|
@@ -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
|
-
|
|
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) {
|
package/factory_gateway.ts
CHANGED
|
@@ -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
|
-
|
|
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) {
|