api.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. import RequestFun from './request.js'
  2. export function getToken(data) { //登录接口
  3. return new RequestFun().fetch(
  4. '/app/user/loginApp',
  5. 'POST',
  6. data
  7. )
  8. }
  9. export function getUser(data) { //查看个人信息
  10. return new RequestFun().fetch(
  11. `/app/user/getUserInfo`,
  12. 'GET',
  13. data
  14. )
  15. }
  16. export function exit(data) { //退出登录
  17. return new RequestFun().fetch(
  18. '/app/user/quitApp',
  19. 'GET',
  20. data
  21. )
  22. }
  23. export function updateMobile(data) { //修改手机号
  24. return new RequestFun().fetch(
  25. '/app/user/updateMobile',
  26. 'POST',
  27. data
  28. )
  29. }
  30. export function updateName(data) { //修改昵称
  31. return new RequestFun().fetch(
  32. '/app/user/updateName',
  33. 'POST',
  34. data
  35. )
  36. }
  37. export function updateIcon(data) { //修改头像
  38. return new RequestFun().fetch(
  39. '/app/user/updateIcon',
  40. 'POST',
  41. data
  42. )
  43. }
  44. export function updateEmail(data) { //修改邮箱
  45. return new RequestFun().fetch(
  46. '/app/user/updateEmail',
  47. 'POST',
  48. data
  49. )
  50. }
  51. export function updatePassword(data) { //修改密码
  52. return new RequestFun().fetch(
  53. '/app/user/updatePassword',
  54. 'POST',
  55. data
  56. )
  57. }
  58. export function updateMsgStatus(data) { //修改消息接收
  59. return new RequestFun().fetch(
  60. '/app/user/updateMsgStatus',
  61. 'POST',
  62. data
  63. )
  64. }
  65. export function addTask(data) { //创建任务
  66. return new RequestFun().fetch(
  67. '/app/task/addTask',
  68. 'POST',
  69. data
  70. )
  71. }
  72. export function followRobot(data) { //关注机器人
  73. return new RequestFun().fetch(
  74. '/app/robot/followRobot',
  75. 'POST',
  76. data
  77. )
  78. }
  79. export function unfollowRobot(data) { //取消关注机器人
  80. return new RequestFun().fetch(
  81. '/app/robot/unfollowRobot',
  82. 'POST',
  83. data
  84. )
  85. }
  86. export function getRobotList(data,complete) { //查询全部机器人
  87. return new RequestFun().fetch(
  88. `/app/robot/getRobotList`,
  89. 'GET',
  90. data,
  91. complete
  92. )
  93. }
  94. export function getEnvData(data) { //获取最新环境数据
  95. return new RequestFun().fetch(
  96. `/app/data/getEnvData`,
  97. 'GET',
  98. data
  99. )
  100. }
  101. export function getRobotStauts(data) { //查询机器人实时状态
  102. return new RequestFun().fetch(
  103. `/app/robot/getRobotStauts`,
  104. 'GET',
  105. data
  106. )
  107. }
  108. export function currentTask(data) { //查询巡检任务列表
  109. return new RequestFun().fetch(
  110. `/app/task/currentTask`,
  111. 'GET',
  112. data
  113. )
  114. }
  115. export function getMessageList(data,complete) { //查看消息列表
  116. return new RequestFun().fetch(
  117. `/app/data/getWarningData`,
  118. 'GET',
  119. data,
  120. complete
  121. )
  122. }
  123. export function readAll(data) { //全部标记已读
  124. return new RequestFun().fetch(
  125. '/app/data/readAll',
  126. 'POST',
  127. data
  128. )
  129. }
  130. export function getReadNum(data) { //全部标记已读
  131. return new RequestFun().fetch(
  132. '/app/data/getNewMsgCount',
  133. 'GET',
  134. data
  135. )
  136. }
  137. export function readMsg(data) { //标记已读
  138. return new RequestFun().fetch(
  139. '/app/data/readMsg',
  140. 'POST',
  141. data
  142. )
  143. }
  144. export function getCheckData(data,complete) { //查询巡检数据
  145. return new RequestFun().fetch(
  146. `/app/data/getCheckData`,
  147. 'GET',
  148. data,
  149. complete
  150. )
  151. }
  152. export function getImage(data) { //查询巡检图片
  153. return new RequestFun().fetch(
  154. `/app/data/getImage`,
  155. 'GET',
  156. data,
  157. null,
  158. 'Blob'
  159. )
  160. }