@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.
- package/dist/energy_gateway.js +1 -1
- package/dist/index.js +4 -0
- package/energy_gateway.ts +1 -1
- package/index.ts +4 -0
- package/package.json +1 -1
package/dist/energy_gateway.js
CHANGED
|
@@ -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/
|
|
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/
|
|
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
|