@cpzxrobot/sdk 1.3.51 → 1.3.52
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 +4 -2
- package/dist/device_filter.js +4 -1
- package/package.json +1 -1
package/device_filter.ts
CHANGED
|
@@ -31,7 +31,7 @@ export abstract class DeviceFilter<T extends { id: number }> {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
add(device: any) {
|
|
34
|
-
this.context.ready.then(axios=>{
|
|
34
|
+
this.context.ready.then(axios => {
|
|
35
35
|
return axios.post("/api/v2/device/add", device)
|
|
36
36
|
})
|
|
37
37
|
}
|
|
@@ -208,7 +208,9 @@ 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
|
|
211
|
+
if (res.data) {
|
|
212
|
+
throw "device_list error("+JSON.stringify(res)+")";
|
|
213
|
+
} else if (res.data.Error) {
|
|
212
214
|
throw res.data.Error;
|
|
213
215
|
}
|
|
214
216
|
// this.devices.push(res.data);
|
package/dist/device_filter.js
CHANGED
|
@@ -189,7 +189,10 @@ class DeviceFilter {
|
|
|
189
189
|
return res;
|
|
190
190
|
}
|
|
191
191
|
else {
|
|
192
|
-
if (res.data
|
|
192
|
+
if (res.data) {
|
|
193
|
+
throw "device_list error(" + JSON.stringify(res) + ")";
|
|
194
|
+
}
|
|
195
|
+
else if (res.data.Error) {
|
|
193
196
|
throw res.data.Error;
|
|
194
197
|
}
|
|
195
198
|
// this.devices.push(res.data);
|