ipanel-rnapp-ajb-base 1.0.21 → 1.0.23

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.
@@ -1,7 +1,7 @@
1
- import {NativeModules} from 'react-native';
2
- import request from '../utils/http';
3
- import config from '../utils/config';
4
- import {homedHttp} from '../utils/http';
1
+ import { NativeModules } from "react-native";
2
+ import request from "../utils/http";
3
+ import config from "../utils/config";
4
+ import { homedHttp } from "../utils/http";
5
5
 
6
6
  const appName = NativeModules?.RNToNativeEmitter?.appName;
7
7
 
@@ -13,20 +13,20 @@ export const ACCOUNT_SERVICE = `${config.IPANEL_CLOUD_BASE_URI}/s/account`;
13
13
 
14
14
  export const ADG_SERVICE = `${config.IPANEL_CLOUD_BASE_ADG_URI}/s/install_ea`;
15
15
 
16
- export const APARTMENT_SERVICE = 'http://192.168.101.193:47070/smartapartment';
16
+ export const APARTMENT_SERVICE = "http://192.168.101.193:47070/smartapartment";
17
17
 
18
18
  // todo 云端获取token服务:https://ai.baidu.com/ai-doc/SPEECH/Mk38lxpgn
19
19
  export const baiduAsr = (cuid, len, speechBase64) => {
20
20
  return request({
21
- url: 'https://vop.baidu.com/pro_api', // 语音识别极速版调用地址
22
- method: 'POST',
21
+ url: "https://vop.baidu.com/pro_api", // 语音识别极速版调用地址
22
+ method: "POST",
23
23
  data: {
24
- format: 'm4a',
24
+ format: "m4a",
25
25
  rate: 16000,
26
26
  dev_pid: 80001,
27
27
  channel: 1,
28
28
  token:
29
- '24.5298600e65d054e08a1290fcc75f174f.2592000.1691141832.282335-17005893',
29
+ "24.5298600e65d054e08a1290fcc75f174f.2592000.1691141832.282335-17005893",
30
30
  cuid: cuid,
31
31
  len,
32
32
  speech: speechBase64, // xxx为 base64(FILE_CONTENT)
@@ -34,9 +34,9 @@ export const baiduAsr = (cuid, len, speechBase64) => {
34
34
  });
35
35
  };
36
36
 
37
- export const getAreaOperatorModules = async params => {
37
+ export const getAreaOperatorModules = async (params) => {
38
38
  let url = `${
39
- appName === '禺乐慧家'
39
+ ["禺乐慧家", "悦慧家"].includes(appName)
40
40
  ? config.PANYU_MODULE_VERSION_URI
41
41
  : config.IPANEL_CLOUD_BASE_URI
42
42
  }/jshomeapp/api/getAreaOperatorModules`;
@@ -44,30 +44,30 @@ export const getAreaOperatorModules = async params => {
44
44
  // todo 本地调试测试临时处理,本地调试时模块列表暂时对接的是dev集群
45
45
  if (!NativeModules?.RNToNativeEmitter?.serverCluster) {
46
46
  url =
47
- 'https://dev.ipanelcloud2.ipanel.cn:50443/jshomeapp/api/getAreaOperatorModules';
47
+ "https://dev.ipanelcloud2.ipanel.cn:50443/jshomeapp/api/getAreaOperatorModules";
48
48
  }
49
49
 
50
- const baseVersionInfo = await global.base.getBundleInfo('base');
50
+ const baseVersionInfo = await global.base.getBundleInfo("base");
51
51
 
52
52
  return request({
53
53
  url: url,
54
54
 
55
- method: 'GET',
55
+ method: "GET",
56
56
  data: {
57
57
  appVersionDependency:
58
58
  NativeModules?.RNToNativeEmitter?.appVersion ||
59
59
  config.LOCALTEST_APP_VERSION,
60
60
  baseVersionDependency: baseVersionInfo?.version
61
61
  ? baseVersionInfo?.version.slice(1) /*去掉v字符*/
62
- : '',
62
+ : "",
63
63
  ...params,
64
64
  },
65
65
  });
66
66
  };
67
67
 
68
- export const getModuleVersionInfo = async params => {
68
+ export const getModuleVersionInfo = async (params) => {
69
69
  let url = `${
70
- appName === '禺乐慧家'
70
+ ["禺乐慧家", "悦慧家"].includes(appName)
71
71
  ? config.PANYU_MODULE_VERSION_URI
72
72
  : config.IPANEL_CLOUD_BASE_URI
73
73
  }/jshomeapp/api/moduleVersionInfo`;
@@ -75,33 +75,33 @@ export const getModuleVersionInfo = async params => {
75
75
  // todo 本地调试测试临时处理,本地调试时模块列表暂时对接的是dev集群
76
76
  if (!NativeModules?.RNToNativeEmitter?.serverCluster) {
77
77
  url =
78
- 'https://dev.ipanelcloud2.ipanel.cn:50443/jshomeapp/api/moduleVersionInfo';
78
+ "https://dev.ipanelcloud2.ipanel.cn:50443/jshomeapp/api/moduleVersionInfo";
79
79
  }
80
80
 
81
- const baseVersionInfo = await global.base.getBundleInfo('base');
81
+ const baseVersionInfo = await global.base.getBundleInfo("base");
82
82
 
83
83
  return request({
84
84
  url: url,
85
85
 
86
- method: 'POST',
86
+ method: "POST",
87
87
  data: {
88
88
  appVersionDependency:
89
89
  NativeModules?.RNToNativeEmitter?.appVersion ||
90
90
  global.base.config.LOCALTEST_APP_VERSION,
91
91
  baseVersionDependency: baseVersionInfo?.version
92
92
  ? baseVersionInfo?.version.slice(1) /*去掉v字符*/
93
- : '',
93
+ : "",
94
94
  ...params,
95
95
  },
96
96
  });
97
97
  };
98
98
 
99
- export const getUserInfo = data => {
99
+ export const getUserInfo = (data) => {
100
100
  return request({
101
101
  url: ACCOUNT_SERVICE,
102
- method: 'POST',
102
+ method: "POST",
103
103
  data: {
104
- action: 'get_user_info',
104
+ action: "get_user_info",
105
105
  ...data,
106
106
  },
107
107
  });
@@ -109,10 +109,10 @@ export const getUserInfo = data => {
109
109
 
110
110
  export const obtainSmscode = (data, type) => {
111
111
  return request({
112
- url: type === 'adg' ? ADG_SERVICE : ACCOUNT_SERVICE,
113
- method: 'POST',
112
+ url: type === "adg" ? ADG_SERVICE : ACCOUNT_SERVICE,
113
+ method: "POST",
114
114
  data: {
115
- action: 'obtain_smscode',
115
+ action: "obtain_smscode",
116
116
  ...data,
117
117
  },
118
118
  });
@@ -120,10 +120,10 @@ export const obtainSmscode = (data, type) => {
120
120
 
121
121
  export const smscodeLogin = (data, type) => {
122
122
  return request({
123
- url: type === 'adg' ? ADG_SERVICE : ACCOUNT_SERVICE,
124
- method: 'POST',
123
+ url: type === "adg" ? ADG_SERVICE : ACCOUNT_SERVICE,
124
+ method: "POST",
125
125
  data: {
126
- action: 'smscode_regist', // 未注册的手机号会注册并登录,已注册的则直接登录
126
+ action: "smscode_regist", // 未注册的手机号会注册并登录,已注册的则直接登录
127
127
  // action: 'smscode_login',
128
128
  ...data,
129
129
  },
@@ -133,46 +133,44 @@ export const smscodeLogin = (data, type) => {
133
133
  // 账号密码登录的方式
134
134
  export const accountLogin = (data, type) => {
135
135
  return request({
136
- url: type === 'adg' ? ADG_SERVICE : ACCOUNT_SERVICE,
137
- method: 'POST',
136
+ url: type === "adg" ? ADG_SERVICE : ACCOUNT_SERVICE,
137
+ method: "POST",
138
138
  data: {
139
- action: 'account_login',
139
+ action: "account_login",
140
140
  ...data,
141
141
  },
142
142
  });
143
143
  };
144
144
 
145
-
146
145
  //账号注册
147
146
  export const accountRegiste = (data, type) => {
148
147
  return request({
149
- url: type === 'adg' ? ADG_SERVICE : ACCOUNT_SERVICE,
150
- method: 'POST',
148
+ url: type === "adg" ? ADG_SERVICE : ACCOUNT_SERVICE,
149
+ method: "POST",
151
150
  data: {
152
- action: 'account_register',
151
+ action: "account_register",
153
152
  ...data,
154
153
  },
155
154
  });
156
155
  };
157
156
 
158
-
159
- export const obtainThirdToken = data => {
157
+ export const obtainThirdToken = (data) => {
160
158
  return request({
161
159
  url: ACCOUNT_SERVICE,
162
- method: 'POST',
160
+ method: "POST",
163
161
  data: {
164
- action: 'obtain_third_token',
162
+ action: "obtain_third_token",
165
163
  ...data,
166
164
  },
167
165
  });
168
166
  };
169
167
 
170
- export const authSmscode = data => {
168
+ export const authSmscode = (data) => {
171
169
  return request({
172
170
  url: ACCOUNT_SERVICE,
173
- method: 'POST',
171
+ method: "POST",
174
172
  data: {
175
- action: 'auth_smscode',
173
+ action: "auth_smscode",
176
174
  ...data,
177
175
  },
178
176
  });
@@ -181,54 +179,54 @@ export const authSmscode = data => {
181
179
  // 刷新token
182
180
  export const refreshToken = (data, type) => {
183
181
  return request({
184
- url: type === 'adg' ? ADG_SERVICE : ACCOUNT_SERVICE,
185
- method: 'POST',
182
+ url: type === "adg" ? ADG_SERVICE : ACCOUNT_SERVICE,
183
+ method: "POST",
186
184
  data: {
187
- action: 'refresh_token',
185
+ action: "refresh_token",
188
186
  ...data,
189
187
  },
190
188
  });
191
189
  };
192
190
 
193
- export const addAddress = data => {
191
+ export const addAddress = (data) => {
194
192
  return request({
195
193
  url: IOT_SERVICE,
196
- method: 'POST',
194
+ method: "POST",
197
195
  data: {
198
- action: 'add_address',
196
+ action: "add_address",
199
197
  ...data,
200
198
  },
201
199
  });
202
200
  };
203
201
 
204
- export const adjustAddress = data => {
202
+ export const adjustAddress = (data) => {
205
203
  return request({
206
204
  url: IOT_SERVICE,
207
- method: 'POST',
205
+ method: "POST",
208
206
  data: {
209
- action: 'adjust_address',
207
+ action: "adjust_address",
210
208
  ...data,
211
209
  },
212
210
  });
213
211
  };
214
212
 
215
- export const delAddress = data => {
213
+ export const delAddress = (data) => {
216
214
  return request({
217
215
  url: IOT_SERVICE,
218
- method: 'POST',
216
+ method: "POST",
219
217
  data: {
220
- action: 'del_address',
218
+ action: "del_address",
221
219
  ...data,
222
220
  },
223
221
  });
224
222
  };
225
223
 
226
- export const addRoom = data => {
224
+ export const addRoom = (data) => {
227
225
  return request({
228
226
  url: IOT_SERVICE,
229
- method: 'POST',
227
+ method: "POST",
230
228
  data: {
231
- action: 'add_room',
229
+ action: "add_room",
232
230
  ...data,
233
231
  },
234
232
  });
@@ -237,54 +235,54 @@ export const addRoom = data => {
237
235
  export const getAddrInfo = (data, timeout) => {
238
236
  return request({
239
237
  url: IOT_SERVICE,
240
- method: 'POST',
238
+ method: "POST",
241
239
  data: {
242
- action: 'get_address_info',
240
+ action: "get_address_info",
243
241
  ...data,
244
242
  },
245
243
  timeout,
246
244
  });
247
245
  };
248
246
 
249
- export const getAddrList = data => {
247
+ export const getAddrList = (data) => {
250
248
  return request({
251
249
  url: IOT_SERVICE,
252
- method: 'POST',
250
+ method: "POST",
253
251
  data: {
254
- action: 'get_address_list',
252
+ action: "get_address_list",
255
253
  ...data,
256
254
  },
257
255
  });
258
256
  };
259
257
 
260
- export const getAddressRooms = data => {
258
+ export const getAddressRooms = (data) => {
261
259
  return request({
262
260
  url: IOT_SERVICE,
263
- method: 'POST',
261
+ method: "POST",
264
262
  data: {
265
- action: 'get_address_rooms',
263
+ action: "get_address_rooms",
266
264
  ...data,
267
265
  },
268
266
  });
269
267
  };
270
268
 
271
- export const adjustRoom = data => {
269
+ export const adjustRoom = (data) => {
272
270
  return request({
273
271
  url: IOT_SERVICE,
274
- method: 'POST',
272
+ method: "POST",
275
273
  data: {
276
- action: 'adjust_room',
274
+ action: "adjust_room",
277
275
  ...data,
278
276
  },
279
277
  });
280
278
  };
281
279
 
282
- export const delRoom = data => {
280
+ export const delRoom = (data) => {
283
281
  return request({
284
282
  url: IOT_SERVICE,
285
- method: 'POST',
283
+ method: "POST",
286
284
  data: {
287
- action: 'del_room',
285
+ action: "del_room",
288
286
  ...data,
289
287
  },
290
288
  });
@@ -294,38 +292,38 @@ export const getDeviceType = () => {
294
292
  return request({
295
293
  url: `${IR_433_DISCOVER_SERVICE}/api/getDeviceType`,
296
294
  // url: 'https://ipanelcloud2.ipanel.cn:50443/s/ir433discover/api/getDeviceType',
297
- method: 'GET',
295
+ method: "GET",
298
296
  });
299
297
  };
300
298
 
301
- export const getBarcodeInfo = params => {
299
+ export const getBarcodeInfo = (params) => {
302
300
  return request({
303
301
  url: `${IR_433_DISCOVER_SERVICE}/api/getBarcodeInfo`,
304
- method: 'GET',
302
+ method: "GET",
305
303
  data: params,
306
304
  });
307
305
  };
308
306
 
309
- export const getTvIrCode = params => {
307
+ export const getTvIrCode = (params) => {
310
308
  return request({
311
309
  url: `${config.IPANEL_CLOUD_BASE_URI}/s/todolist/tvmiddleware/getirtv`,
312
- method: 'GET',
310
+ method: "GET",
313
311
  data: params,
314
312
  });
315
313
  };
316
314
 
317
- export const getTemplateCode = params => {
315
+ export const getTemplateCode = (params) => {
318
316
  return request({
319
317
  url: `${IR_433_DISCOVER_SERVICE}/api/getTemplateCode`,
320
- method: 'GET',
318
+ method: "GET",
321
319
  data: params,
322
320
  });
323
321
  };
324
322
 
325
- export const getDeviceCode = params => {
323
+ export const getDeviceCode = (params) => {
326
324
  return request({
327
325
  url: `${IR_433_DISCOVER_SERVICE}/api/getDeviceCode`,
328
- method: 'GET',
326
+ method: "GET",
329
327
  data: params,
330
328
  });
331
329
  };
@@ -339,81 +337,81 @@ const getCurrentAddrRoomkeeperServiceBaseUri = async function () {
339
337
 
340
338
  // request函数执行后返回一个请求的Promise对象
341
339
 
342
- export const assignDeviceAddr = async data => {
340
+ export const assignDeviceAddr = async (data) => {
343
341
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
344
342
  return request({
345
343
  url: ROOMKEEPER_SERVICE,
346
- method: 'POST',
344
+ method: "POST",
347
345
  data: {
348
- path: 'device/assign_addr',
346
+ path: "device/assign_addr",
349
347
  ...data,
350
348
  },
351
349
  });
352
350
  };
353
351
 
354
- export const getDeviceList = async data => {
352
+ export const getDeviceList = async (data) => {
355
353
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
356
354
  return request({
357
355
  url: ROOMKEEPER_SERVICE,
358
- method: 'POST',
356
+ method: "POST",
359
357
  data: {
360
- path: 'device/get_device_list',
358
+ path: "device/get_device_list",
361
359
  ...data,
362
360
  },
363
361
  });
364
362
  };
365
363
 
366
- export const adjustDevice = async data => {
364
+ export const adjustDevice = async (data) => {
367
365
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
368
366
  return request({
369
367
  url: ROOMKEEPER_SERVICE,
370
- method: 'POST',
368
+ method: "POST",
371
369
  data: {
372
- path: 'device/adjust_device',
370
+ path: "device/adjust_device",
373
371
  ...data,
374
372
  },
375
373
  });
376
374
  };
377
375
 
378
- export const addDevice = async data => {
376
+ export const addDevice = async (data) => {
379
377
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
380
378
  return request({
381
379
  url: ROOMKEEPER_SERVICE,
382
- method: 'POST',
380
+ method: "POST",
383
381
  data: {
384
- path: 'device/add_device',
382
+ path: "device/add_device",
385
383
  ...data,
386
384
  },
387
385
  });
388
386
  };
389
387
 
390
- export const moveDevice = async data => {
388
+ export const moveDevice = async (data) => {
391
389
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
392
390
  return request({
393
391
  url: ROOMKEEPER_SERVICE,
394
- method: 'POST',
392
+ method: "POST",
395
393
  data: {
396
- path: 'device/move_device',
394
+ path: "device/move_device",
397
395
  ...data,
398
396
  },
399
397
  });
400
398
  };
401
399
 
402
- export const getsn = data => {
400
+ export const getsn = (data) => {
403
401
  return request({
404
402
  url: `${config.IPANEL_CLOUD_BASE_URI}/todolist/itee/getsn`,
405
- method: 'GET',
403
+ method: "GET",
406
404
  data,
407
405
  });
408
406
  };
409
407
 
410
- export const delDevice = async data => {
408
+ export const delDevice = async (data) => {
411
409
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
412
410
  return request({
413
411
  url: ROOMKEEPER_SERVICE,
414
- method: 'POST',
412
+ method: "POST",
415
413
  data: {
416
- path: 'device/delete_device',
414
+ path: "device/delete_device",
417
415
  ...data,
418
416
  },
419
417
  });
@@ -423,235 +421,235 @@ export const getDeviceStatusStructures = async () => {
423
421
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
424
422
  return request({
425
423
  url: ROOMKEEPER_SERVICE,
426
- method: 'POST',
424
+ method: "POST",
427
425
  data: {
428
- path: 'itee_cloud/get_device_status_structures',
426
+ path: "itee_cloud/get_device_status_structures",
429
427
  },
430
428
  });
431
429
  };
432
430
 
433
- export const getRoomDeviceStatuses = async data => {
431
+ export const getRoomDeviceStatuses = async (data) => {
434
432
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
435
433
  return request({
436
434
  url: ROOMKEEPER_SERVICE,
437
- method: 'POST',
435
+ method: "POST",
438
436
  data: {
439
- path: 'itee_cloud/get_device_status',
437
+ path: "itee_cloud/get_device_status",
440
438
  ...data,
441
439
  },
442
440
  });
443
441
  };
444
442
 
445
443
  // 上报和有效性验证
446
- export const reportCheckData = params => {
444
+ export const reportCheckData = (params) => {
447
445
  return request({
448
446
  url: `${IR_433_DISCOVER_SERVICE}/api/reportCheckData`,
449
- method: 'POST',
447
+ method: "POST",
450
448
  data: params,
451
449
  });
452
450
  };
453
451
 
454
452
  // 获取设备参数信息
455
- export const get433DeviceInfo = params => {
453
+ export const get433DeviceInfo = (params) => {
456
454
  return request({
457
455
  url: `${IR_433_DISCOVER_SERVICE}/api/getDeviceInfo`,
458
- method: 'GET',
456
+ method: "GET",
459
457
  data: params,
460
458
  });
461
459
  };
462
460
 
463
461
  // 获取设备类型品牌型号对应的按键列表信息
464
- export const getKeyCode = params => {
462
+ export const getKeyCode = (params) => {
465
463
  return request({
466
464
  url: `${IR_433_DISCOVER_SERVICE}/api/getKeyCode`,
467
- method: 'GET',
465
+ method: "GET",
468
466
  data: params,
469
467
  });
470
468
  };
471
469
 
472
470
  // 创建码库id
473
- export const generateCodeLibraryId = params => {
471
+ export const generateCodeLibraryId = (params) => {
474
472
  return request({
475
473
  url: `${IR_433_DISCOVER_SERVICE}/api/generateCodeLibraryId`,
476
- method: 'GET',
474
+ method: "GET",
477
475
  data: params,
478
476
  });
479
477
  };
480
478
 
481
- export const taskNotify = async data => {
479
+ export const taskNotify = async (data) => {
482
480
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
483
481
  return request({
484
482
  url: ROOMKEEPER_SERVICE,
485
- method: 'POST',
483
+ method: "POST",
486
484
  data: {
487
- path: 'itee_cloud/task_notify',
485
+ path: "itee_cloud/task_notify",
488
486
  ...data,
489
487
  },
490
488
  });
491
489
  };
492
490
 
493
- export const thermostatTimingGet = async data => {
491
+ export const thermostatTimingGet = async (data) => {
494
492
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
495
493
  return request({
496
494
  url: ROOMKEEPER_SERVICE,
497
- method: 'POST',
495
+ method: "POST",
498
496
  data: {
499
- path: 'itee_cloud/thermostat_timing_get',
497
+ path: "itee_cloud/thermostat_timing_get",
500
498
  ...data,
501
499
  },
502
500
  });
503
501
  };
504
502
 
505
- export const thermostatTimingAdd = async data => {
503
+ export const thermostatTimingAdd = async (data) => {
506
504
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
507
505
  return request({
508
506
  url: ROOMKEEPER_SERVICE,
509
- method: 'POST',
507
+ method: "POST",
510
508
  data: {
511
- path: 'itee_cloud/thermostat_timing_add',
509
+ path: "itee_cloud/thermostat_timing_add",
512
510
  ...data,
513
511
  },
514
512
  });
515
513
  };
516
514
 
517
- export const thermostatTimingDelete = async data => {
515
+ export const thermostatTimingDelete = async (data) => {
518
516
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
519
517
  return request({
520
518
  url: ROOMKEEPER_SERVICE,
521
- method: 'POST',
519
+ method: "POST",
522
520
  data: {
523
- path: 'itee_cloud/thermostat_timing_delete',
521
+ path: "itee_cloud/thermostat_timing_delete",
524
522
  ...data,
525
523
  },
526
524
  });
527
525
  };
528
526
 
529
- export const thermostatTimingEnable = async data => {
527
+ export const thermostatTimingEnable = async (data) => {
530
528
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
531
529
  return request({
532
530
  url: ROOMKEEPER_SERVICE,
533
- method: 'POST',
531
+ method: "POST",
534
532
  data: {
535
- path: 'itee_cloud/thermostat_timing_enable',
533
+ path: "itee_cloud/thermostat_timing_enable",
536
534
  ...data,
537
535
  },
538
536
  });
539
537
  };
540
538
 
541
- export const removeDeviceFromGroup = async data => {
539
+ export const removeDeviceFromGroup = async (data) => {
542
540
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
543
541
  return request({
544
542
  url: ROOMKEEPER_SERVICE,
545
- method: 'POST',
543
+ method: "POST",
546
544
  data: {
547
- path: 'device/remove_from_group',
545
+ path: "device/remove_from_group",
548
546
  ...data,
549
547
  },
550
548
  });
551
549
  };
552
550
 
553
551
  // 重启itee
554
- export const sendReboot = params => {
552
+ export const sendReboot = (params) => {
555
553
  return request({
556
554
  url: `${IR_433_DISCOVER_SERVICE}/inviter/sendReboot`,
557
- method: 'GET',
555
+ method: "GET",
558
556
  data: params,
559
557
  });
560
558
  };
561
559
 
562
560
  // 获取设备分组列表
563
- export const getDeviceGroupList = async data => {
561
+ export const getDeviceGroupList = async (data) => {
564
562
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
565
563
  return request({
566
564
  url: ROOMKEEPER_SERVICE,
567
- method: 'POST',
565
+ method: "POST",
568
566
  data: {
569
- path: 'group/get_list',
567
+ path: "group/get_list",
570
568
  ...data,
571
569
  },
572
570
  });
573
571
  };
574
572
 
575
- export const getDeviceGroupInfo = async data => {
573
+ export const getDeviceGroupInfo = async (data) => {
576
574
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
577
575
  return request({
578
576
  url: ROOMKEEPER_SERVICE,
579
- method: 'POST',
577
+ method: "POST",
580
578
  data: {
581
- path: 'group/get_info',
579
+ path: "group/get_info",
582
580
  ...data,
583
581
  },
584
582
  });
585
583
  };
586
584
 
587
- export const addDeviceToGroup = async data => {
585
+ export const addDeviceToGroup = async (data) => {
588
586
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
589
587
  return request({
590
588
  url: ROOMKEEPER_SERVICE,
591
- method: 'POST',
589
+ method: "POST",
592
590
  data: {
593
- path: 'device/add_to_group',
591
+ path: "device/add_to_group",
594
592
  ...data,
595
593
  },
596
594
  });
597
595
  };
598
596
 
599
- export const getDeviceInfo = async data => {
597
+ export const getDeviceInfo = async (data) => {
600
598
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
601
599
  return request({
602
600
  url: ROOMKEEPER_SERVICE,
603
- method: 'POST',
601
+ method: "POST",
604
602
  data: {
605
- path: 'device/get_device_info',
603
+ path: "device/get_device_info",
606
604
  ...data,
607
605
  },
608
606
  });
609
607
  };
610
608
 
611
- export const getTreeOptions = params => {
609
+ export const getTreeOptions = (params) => {
612
610
  return request({
613
611
  url: `${config.IPANEL_CLOUD_BASE_URI}/s/treeinput/get_options`,
614
- method: 'GET',
612
+ method: "GET",
615
613
  data: params,
616
614
  });
617
615
  };
618
616
 
619
- export const getTreeChildOptions = params => {
617
+ export const getTreeChildOptions = (params) => {
620
618
  return request({
621
619
  url: `${config.IPANEL_CLOUD_BASE_URI}/s/treeinput/get_child_options`,
622
- method: 'GET',
620
+ method: "GET",
623
621
  data: params,
624
622
  });
625
623
  };
626
624
 
627
- export const addInvoiceTitle = data => {
625
+ export const addInvoiceTitle = (data) => {
628
626
  return request({
629
627
  url: INVOICE_SERVICE,
630
- method: 'POST',
628
+ method: "POST",
631
629
  data: {
632
- action: 'add_invoice_title',
630
+ action: "add_invoice_title",
633
631
  ...data,
634
632
  },
635
633
  });
636
634
  };
637
635
 
638
- export const adjustInvoiceTitle = data => {
636
+ export const adjustInvoiceTitle = (data) => {
639
637
  return request({
640
638
  url: INVOICE_SERVICE,
641
- method: 'POST',
639
+ method: "POST",
642
640
  data: {
643
- action: 'adjust_invoice_title',
641
+ action: "adjust_invoice_title",
644
642
  ...data,
645
643
  },
646
644
  });
647
645
  };
648
646
 
649
- export const delInvoiceTitle = data => {
647
+ export const delInvoiceTitle = (data) => {
650
648
  return request({
651
649
  url: INVOICE_SERVICE,
652
- method: 'POST',
650
+ method: "POST",
653
651
  data: {
654
- action: 'del_invoice_title',
652
+ action: "del_invoice_title",
655
653
  ...data,
656
654
  },
657
655
  });
@@ -660,137 +658,141 @@ export const delInvoiceTitle = data => {
660
658
  export const getInvoiceTitle = () => {
661
659
  return request({
662
660
  url: INVOICE_SERVICE,
663
- method: 'POST',
661
+ method: "POST",
664
662
  data: {
665
- action: 'get_invoice_title',
663
+ action: "get_invoice_title",
666
664
  },
667
665
  });
668
666
  };
669
667
 
670
- export const getAddressUser = data => {
668
+ export const getAddressUser = (data) => {
671
669
  return request({
672
670
  url: ACCOUNT_SERVICE,
673
- method: 'POST',
671
+ method: "POST",
674
672
  data: {
675
- action: 'get_address_user',
673
+ action: "get_address_user",
676
674
  detail: true,
677
675
  ...data,
678
676
  },
679
677
  });
680
678
  };
681
679
 
682
- export const getCloudInfo = async data => {
683
- const domain = await global.base.getHomedDomain()
684
- const host = domain === 'pyitv.com' ? 14890 : 80
680
+ export const getCloudInfo = async (data) => {
681
+ const domain = await global.base.getHomedDomain();
682
+ const host = domain === "pyitv.com" ? 14890 : 80;
685
683
  return homedHttp({
686
684
  url: `http://izone.${domain}:${host}/account/cloud/get_info`,
687
- method: 'GET',
685
+ method: "GET",
688
686
  data,
689
687
  });
690
688
  };
691
689
 
692
- export const getCloudFileList = async data => {
693
- const domain = await global.base.getHomedDomain()
694
- const host = domain === 'pyitv.com' ? 14890 : 80
690
+ export const getCloudFileList = async (data) => {
691
+ const domain = await global.base.getHomedDomain();
692
+ const host = domain === "pyitv.com" ? 14890 : 80;
695
693
  return homedHttp({
696
694
  url: `http://izone.${domain}:${host}/account/cloud/file/get_list`,
697
- method: 'GET',
695
+ method: "GET",
698
696
  data,
699
697
  });
700
698
  };
701
699
 
702
- export const openCloudService = async data => {
703
- const domain = await global.base.getHomedDomain()
704
- const host = domain === 'pyitv.com' ? 14890 : 80
700
+ export const openCloudService = async (data) => {
701
+ const domain = await global.base.getHomedDomain();
702
+ const host = domain === "pyitv.com" ? 14890 : 80;
705
703
  return homedHttp({
706
704
  url: `http://izone.${domain}:${host}/account/cloud/open`,
707
- method: 'POST',
705
+ method: "POST",
708
706
  data,
709
707
  });
710
708
  };
711
709
 
712
- export const deleteCloudFile = async data => {
713
- const domain = await global.base.getHomedDomain()
714
- const host = domain === 'pyitv.com' ? 14890 : 80
710
+ export const deleteCloudFile = async (data) => {
711
+ const domain = await global.base.getHomedDomain();
712
+ const host = domain === "pyitv.com" ? 14890 : 80;
715
713
  return homedHttp({
716
714
  url: `http://izone.${domain}:${host}/account/cloud/file/delete`,
717
- method: 'POST',
715
+ method: "POST",
718
716
  data,
719
717
  });
720
718
  };
721
719
 
722
720
  // 根据设备对应id获取题库
723
- export const getProductAnswers = questionId => {
721
+ export const getProductAnswers = (questionId) => {
724
722
  return request({
725
- url: `https://${appName === '禺乐慧家' ? 'szjtyfw.panyu.gd.cn:50443' : 'api.cloud.ipanel.cn'}/vgatehelp/ajb/getProductAnswers/${questionId}`,
726
- method: 'GET',
723
+ url: `https://${
724
+ ["禺乐慧家", "悦慧家"].includes(appName)
725
+ ? "szjtyfw.panyu.gd.cn:50443"
726
+ : "api.cloud.ipanel.cn"
727
+ }/vgatehelp/ajb/getProductAnswers/${questionId}`,
728
+ method: "GET",
727
729
  });
728
730
  };
729
731
 
730
- export const getSceneModes = async data => {
732
+ export const getSceneModes = async (data) => {
731
733
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
732
734
  return request({
733
735
  url: ROOMKEEPER_SERVICE,
734
- method: 'POST',
736
+ method: "POST",
735
737
  data: {
736
- path: 'scene/get_modes/itee',
738
+ path: "scene/get_modes/itee",
737
739
  ...data,
738
740
  },
739
741
  });
740
742
  };
741
743
 
742
- export const sceneNotify = async data => {
744
+ export const sceneNotify = async (data) => {
743
745
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
744
746
  return request({
745
747
  url: ROOMKEEPER_SERVICE,
746
- method: 'POST',
748
+ method: "POST",
747
749
  data: {
748
- path: 'scene/notify',
750
+ path: "scene/notify",
749
751
  ...data,
750
752
  },
751
753
  });
752
754
  };
753
755
 
754
- export const getDeviceStatusReportHistory = async data => {
756
+ export const getDeviceStatusReportHistory = async (data) => {
755
757
  const ROOMKEEPER_SERVICE = await getCurrentAddrRoomkeeperServiceBaseUri();
756
758
  return request({
757
759
  url: ROOMKEEPER_SERVICE,
758
- method: 'POST',
760
+ method: "POST",
759
761
  data: {
760
- path: 'scene/get_report_history',
762
+ path: "scene/get_report_history",
761
763
  ...data,
762
764
  },
763
765
  });
764
766
  };
765
767
 
766
768
  // 获取公寓token
767
- export const switchToken = async params => {
769
+ export const switchToken = async (params) => {
768
770
  return request({
769
771
  url: `${APARTMENT_SERVICE}/switch_token`,
770
- method: 'GET',
772
+ method: "GET",
771
773
  data: params,
772
774
  });
773
775
  };
774
776
 
775
777
  // 绑定boss账号
776
- export const bindBossAccount = data => {
778
+ export const bindBossAccount = (data) => {
777
779
  return request({
778
780
  url: ACCOUNT_SERVICE,
779
- method: 'POST',
781
+ method: "POST",
780
782
  data: {
781
- action: 'bind_boss_account',
783
+ action: "bind_boss_account",
782
784
  ...data,
783
785
  },
784
786
  });
785
787
  };
786
788
 
787
789
  // 获取用户资产
788
- export const getAssets = data => {
790
+ export const getAssets = (data) => {
789
791
  return request({
790
792
  url: ACCOUNT_SERVICE,
791
- method: 'POST',
793
+ method: "POST",
792
794
  data: {
793
- action: 'get_assets',
795
+ action: "get_assets",
794
796
  ...data,
795
797
  },
796
798
  });
@@ -800,31 +802,31 @@ export const getAssets = data => {
800
802
  export const reportBigData = (tag, sn, data) => {
801
803
  return request({
802
804
  url: `${config.IPANEL_CLOUD_BASE_URI}/reportaccess/collection`,
803
- method: 'POST',
805
+ method: "POST",
804
806
  data: `tag/${tag} version/1 sn/${sn} time/${Date.now()} type/json
805
807
  ${JSON.stringify(data)}`,
806
808
  });
807
809
  };
808
810
 
809
811
  // 重置密码
810
- export const changePwdByPhone = data => {
812
+ export const changePwdByPhone = (data) => {
811
813
  return request({
812
814
  url: ACCOUNT_SERVICE,
813
- method: 'POST',
815
+ method: "POST",
814
816
  data: {
815
- action: 'change_account_pwd_by_phone',
817
+ action: "change_account_pwd_by_phone",
816
818
  ...data,
817
819
  },
818
820
  });
819
821
  };
820
822
 
821
823
  //查询账号
822
- export const queryCountByName = data => {
824
+ export const queryCountByName = (data) => {
823
825
  return request({
824
826
  url: ACCOUNT_SERVICE,
825
- method: 'POST',
827
+ method: "POST",
826
828
  data: {
827
- action: 'query_account_by_name',
829
+ action: "query_account_by_name",
828
830
  ...data,
829
831
  },
830
832
  });