@cpzxrobot/sdk 1.0.47 → 1.0.49

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.
@@ -94,7 +94,7 @@ class PigfarmGateway extends Object {
94
94
  //设置,传入id或对象,action为dayage时需要传回设置的天数
95
95
  set: async (lamp, action, arg) => {
96
96
  var axios = await this.context.ready;
97
- var url = action === "dayage" ? "/api/v1/pigfarm/heatLamp/syncDayage" : "";
97
+ var url = action === "dayage" ? "/api/v1/pigfarm/heatLamp/syncDayage" : `/api/v1/pigfarm/heatLamp/config/set`;
98
98
  var id = typeof lamp === "number" ? lamp : lamp.id;
99
99
  var body = {
100
100
  id
@@ -103,7 +103,7 @@ class PigfarmGateway extends Object {
103
103
  case "dayage":
104
104
  body["days"] = arg;
105
105
  }
106
- return axios.post(`/api/v1/pigfarm/heatLamp/config/set`, lamp);
106
+ return axios.post(url, body);
107
107
  },
108
108
  get: async (id) => {
109
109
  var axios = await this.context.ready;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -112,7 +112,7 @@ export class PigfarmGateway extends Object {
112
112
  //设置,传入id或对象,action为dayage时需要传回设置的天数
113
113
  set: async (lamp: HeatLamp, action: "dayage",arg: any): Promise<any> => {
114
114
  var axios = await this.context.ready;
115
- var url = action === "dayage" ? "/api/v1/pigfarm/heatLamp/syncDayage" : "";
115
+ var url = action === "dayage" ? "/api/v1/pigfarm/heatLamp/syncDayage" : `/api/v1/pigfarm/heatLamp/config/set`;
116
116
  var id = typeof lamp === "number" ? lamp : lamp.id;
117
117
  var body:{
118
118
  id: number,
@@ -124,7 +124,7 @@ export class PigfarmGateway extends Object {
124
124
  case "dayage":
125
125
  body["days"] = arg;
126
126
  }
127
- return axios.post(`/api/v1/pigfarm/heatLamp/config/set`, lamp);
127
+ return axios.post(url, body);
128
128
  },
129
129
  get: async (id: number): Promise<any> => {
130
130
  var axios = await this.context.ready;