airdoor.api.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import { defHttp } from '/@/utils/http/axios';
  2. import { AesEncryption } from '/@/utils/cipher';
  3. import { loginCipher } from '/@/settings/encryptionSetting';
  4. enum Api {
  5. getDevice = '/monitor/device',
  6. getCameraUrl = '/monitor/camera/queryByCameraCode',
  7. devicecontrol = '/safety/ventanalyMonitorData/devicecontrol_ssl',
  8. insertSyncRule = '/ventanaly-device/synccontrol/upcoming/saveOrUpdateRule',
  9. upcoming = '/ventanaly-device/synccontrol/upcoming',
  10. GetSyncRule='/ventanaly-device/synccontrol/upcoming/GetSyncRule',
  11. GetSyncRuleOperationLog='/ventanaly-device/synccontrol/upcoming/GetSyncRuleOperationLog',
  12. GetSyncRuleExecLog='/ventanaly-device/synccontrol/upcoming/GetSyncRuleExecLog'
  13. }
  14. /**
  15. * 风门列表
  16. * @param params
  17. */
  18. export const getDevice = (params) => defHttp.post({ url: Api.getDevice, params });
  19. export const cameraAddr = (params) => defHttp.get({ url: Api.getCameraUrl, params });
  20. /**
  21. *同步开启/同步关闭
  22. * @param params
  23. */
  24. export const devicecontrol = (params) => {
  25. // 加密password
  26. const encryption = new AesEncryption({ key: loginCipher.key, iv: loginCipher.iv });
  27. params.password = encryption.encryptByAES(params.password);
  28. return defHttp.put({ url: Api.devicecontrol, params });
  29. };
  30. /**
  31. * 定时设置-读取规则
  32. * @param params
  33. */
  34. export const GetSyncRule = (params) => defHttp.post({ url: Api.GetSyncRule, params });
  35. /**
  36. * 定时设置-修改规则
  37. * @param params
  38. */
  39. export const insertSyncRule = (params) => {
  40. // 加密password
  41. //const encryption = new AesEncryption({ key: loginCipher.key, iv: loginCipher.iv });
  42. //params.password = encryption.encryptByAES(params.password);
  43. return defHttp.post({ url: Api.insertSyncRule, params });
  44. };
  45. //读取未来30秒内的预告
  46. export const upcoming = (params) => defHttp.get({ url: Api.upcoming, params });
  47. //读取规则日志
  48. export const GetSyncRuleOperationLog = (params) => defHttp.get({ url: Api.GetSyncRuleOperationLog, params });
  49. //读取集控风门操作日志
  50. export const GetSyncRuleExecLog = (params) => defHttp.get({ url: Api.GetSyncRuleExecLog, params });