@cpzxrobot/sdk 1.2.60 → 1.2.61

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.
@@ -38,7 +38,7 @@ class EnergyGateway extends Object {
38
38
  request.factory_id = factory.id;
39
39
  }
40
40
  const axios = await this.context.ready;
41
- return axios.post('/api/v3/energy/stat', {
41
+ return axios.post('/api/v3/energy/createstat', {
42
42
  factory_id: request.factory_id,
43
43
  time: request.time.toISOString(),
44
44
  period: request.period,
package/dist/index.js CHANGED
@@ -106,6 +106,10 @@ class Cpzxrobot {
106
106
  };
107
107
  const instance = {
108
108
  get: async (url, config) => {
109
+ if (config.params) {
110
+ url += "?" + new URLSearchParams(config.params).toString();
111
+ delete config.params;
112
+ }
109
113
  const response = await fetchWithAuth(url, {
110
114
  method: 'GET',
111
115
  headers: config === null || config === void 0 ? void 0 : config.headers
package/energy_gateway.ts CHANGED
@@ -48,7 +48,7 @@ export class EnergyGateway extends Object {
48
48
  request.factory_id = factory.id;
49
49
  }
50
50
  const axios = await this.context.ready;
51
- return axios.post('/api/v3/energy/stat', {
51
+ return axios.post('/api/v3/energy/createstat', {
52
52
  factory_id: request.factory_id,
53
53
  time: request.time.toISOString(),
54
54
  period: request.period,
package/index.ts CHANGED
@@ -125,6 +125,10 @@ export class Cpzxrobot {
125
125
 
126
126
  const instance = {
127
127
  get: async (url: string, config?: any) => {
128
+ if (config.params) {
129
+ url += "?" + new URLSearchParams(config.params).toString();
130
+ delete config.params;
131
+ }
128
132
  const response = await fetchWithAuth(url, {
129
133
  method: 'GET',
130
134
  headers: config?.headers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.60",
3
+ "version": "1.2.61",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {