api.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. const {
  2. request,
  3. threeElementsRequest
  4. } = require("../func/request");
  5. // let path = 'http://192.168.77.14:9100/yx-fyzd'
  6. // let path = 'https://test.hz-hanghui.com:18890/yx-fyzd'
  7. let path = 'https://tx.hz-hanghui.com:8088/yx-fyzd'
  8. // let platform = 'http://192.168.77.19:8081/hanghui-server-platform'
  9. let platform = 'https://tx.hz-hanghui.com:8088/hanghui-server-platform'
  10. let hzHanghui = 'https://noise.hz-hanghui.com:8088/fyzd'
  11. // 访客机设备-获取配置信息
  12. const snConfig = data => {
  13. return request({
  14. url: platform + "/api/v1/fkj/device/sn/config",
  15. data: data,
  16. method: "post",
  17. type: "application/json",
  18. errorTip: '设备配置获取失败 '
  19. });
  20. };
  21. // 访客机设备-修改配置信息
  22. const updateConfig = data => {
  23. return request({
  24. url: "/api/v1/fkj/device/sn/updateConfig",
  25. data: data,
  26. method: "post",
  27. type: "application/json",
  28. errorTip: '操作失败 '
  29. });
  30. };
  31. // 获取访客机辖区配置信息
  32. const areaInfo = data => {
  33. return request({
  34. url: path + "/api/v1/fkj/area/info",
  35. data: data,
  36. method: "post",
  37. type: "application/json",
  38. errorTip: '辖区配置获取失败 '
  39. });
  40. };
  41. // 获取楼层对应关系配置列表
  42. const configList = data => {
  43. return request({
  44. url: path + "/floor/config/list",
  45. data: data,
  46. method: "post",
  47. type: "application/json",
  48. errorTip: '楼层对应关系配置列表获取失败 '
  49. });
  50. };
  51. // 获取受访人列表
  52. const visiteeList = (url, data) => {
  53. return request({
  54. url: url,
  55. data: data,
  56. method: "post",
  57. type: "application/json",
  58. errorTip: '受访人列表获取失败 '
  59. });
  60. };
  61. // 设备上报心跳
  62. const tracking = data => {
  63. return request({
  64. url: path + "/api/v1/fkj/heart/tracking",
  65. data: data,
  66. method: "post",
  67. type: "application/json",
  68. errorTip: '上报心跳失败 '
  69. });
  70. };
  71. // 访客单机版二维码生成 TODO 暂未用到
  72. const ethQrCode = (url, data) => {
  73. return request({
  74. url: url,
  75. data: data,
  76. method: "post",
  77. type: "application/json",
  78. errorTip: '梯控二维码获取失败 '
  79. });
  80. };
  81. // 访客联机版(微光)二维码生成 TODO 暂未用到
  82. const vguangQrCode = (url, data) => {
  83. return request({
  84. url: url,
  85. data: data,
  86. method: "post",
  87. type: "application/json",
  88. errorTip: '闸机二维码获取失败 '
  89. });
  90. };
  91. // 拿用户身份证号换取三要素信息
  92. const userInfoQuery = data => {
  93. return request({
  94. url: platform + "/api/v1/open/user/sync/query",
  95. data: data,
  96. method: "post",
  97. type: "application/json",
  98. timeout: 25000,
  99. errorTip: '用户信息获取失败 '
  100. });
  101. };
  102. // ⾃然⼈⻛险评分查询
  103. const riskQuery = data => {
  104. return request({
  105. url: platform + "/api/v1/risk/query",
  106. data: data,
  107. method: "post",
  108. type: "application/json",
  109. errorTip: '查询失败 '
  110. });
  111. };
  112. // 获取三要素在线配置接口
  113. const threeElementsConfiguration = data => {
  114. return request({
  115. url: platform + "/api/v1/iot/device/config/sn/config",
  116. data: data,
  117. method: "post",
  118. type: "application/json",
  119. errorTip: '在线配置接口获取失败 '
  120. });
  121. };
  122. // 传入接口
  123. const threeElements = (url, data) => {
  124. return threeElementsRequest({
  125. url: url,
  126. data: data,
  127. method: "post",
  128. type: "application/json",
  129. errorTip: '操作失败 '
  130. });
  131. };
  132. // 访客信息推送 TODO 暂未用到
  133. const visitorRecords = (url, data) => {
  134. return threeElementsRequest({
  135. url: url,
  136. data: JSON.stringify(data),
  137. method: "post",
  138. type: "application/json",
  139. errorTip: '访客信息推送失败 '
  140. });
  141. };
  142. // 小程序二维码登记
  143. const getVisitDeviceUser = (data) => {
  144. return request({
  145. url: hzHanghui + '/api/next/getVisitDeviceUser',
  146. data: data,
  147. method: "get",
  148. type: "application/x-www-form-urlencoded",
  149. errorTip: '登记失败 '
  150. });
  151. };
  152. // 访客机-登记信息列表
  153. const visitorReportPageList = (data) => {
  154. return request({
  155. url: path + '/visitorReportPageList',
  156. data: data,
  157. method: "post",
  158. type: "application/json",
  159. errorTip: '操作失败 '
  160. });
  161. };
  162. // 访客机-列表签离
  163. const visitorSignOut = (data) => {
  164. return request({
  165. url: path + '/visitorSignOut',
  166. data: data,
  167. method: "post",
  168. type: "application/json",
  169. errorTip: '签离失败 '
  170. });
  171. };
  172. // 访客机登记信息推送返回唯一值 TODO 暂未用到
  173. const visitorReport = (data) => {
  174. return request({
  175. url: path + '/visitorReport',
  176. data: data,
  177. method: "post",
  178. type: "application/json",
  179. errorTip: '获取失败 '
  180. });
  181. };
  182. // 扫码签离
  183. const visitorCodeSignOut = (data) => {
  184. return request({
  185. url: path + '/visitorCodeSignOut',
  186. data: data,
  187. method: "post",
  188. type: "application/json",
  189. errorTip: ' '
  190. });
  191. };
  192. module.exports = {
  193. snConfig,
  194. updateConfig,
  195. areaInfo,
  196. visiteeList,
  197. tracking,
  198. ethQrCode,
  199. vguangQrCode,
  200. userInfoQuery,
  201. riskQuery,
  202. threeElementsConfiguration,
  203. threeElements,
  204. visitorRecords,
  205. getVisitDeviceUser,
  206. visitorReportPageList,
  207. visitorSignOut,
  208. visitorCodeSignOut,
  209. visitorReport,
  210. configList,
  211. };