api.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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 addTask(data) { //创建任务
  59. return new RequestFun().fetch(
  60. '/app/task/addTask',
  61. 'POST',
  62. data
  63. )
  64. }
  65. export function followRobot(data) { //关注机器人
  66. return new RequestFun().fetch(
  67. '/app/robot/followRobot',
  68. 'POST',
  69. data
  70. )
  71. }
  72. export function unfollowRobot(data) { //取消关注机器人
  73. return new RequestFun().fetch(
  74. '/app/robot/unfollowRobot',
  75. 'POST',
  76. data
  77. )
  78. }
  79. export function getRobotList(data,complete) { //查询全部机器人
  80. return new RequestFun().fetch(
  81. `/app/robot/getRobotList`,
  82. 'GET',
  83. data,
  84. complete
  85. )
  86. }
  87. export function getEnvData(data) { //获取最新环境数据
  88. return new RequestFun().fetch(
  89. `/app/data/getEnvData`,
  90. 'GET',
  91. data
  92. )
  93. }
  94. export function getRobotStauts(data) { //查询机器人实时状态
  95. return new RequestFun().fetch(
  96. `/app/robot/getRobotStauts`,
  97. 'GET',
  98. data
  99. )
  100. }
  101. export function currentTask(data) { //查询巡检任务列表
  102. return new RequestFun().fetch(
  103. `/app/task/currentTask`,
  104. 'GET',
  105. data
  106. )
  107. }
  108. export function getMessageList(data,complete) { //查看消息列表
  109. return new RequestFun().fetch(
  110. `/app/data/getWarningData`,
  111. 'GET',
  112. data,
  113. complete
  114. )
  115. }
  116. export function readAll(data) { //全部标记已读
  117. return new RequestFun().fetch(
  118. '/app/data/readAll',
  119. 'POST',
  120. data
  121. )
  122. }
  123. export function readMsg(data) { //标记已读
  124. return new RequestFun().fetch(
  125. '/app/data/readMsg',
  126. 'POST',
  127. data
  128. )
  129. }
  130. export function getCheckData(data,complete) { //查询巡检数据
  131. return new RequestFun().fetch(
  132. `/app/data/getCheckData`,
  133. 'GET',
  134. data,
  135. complete
  136. )
  137. }
  138. export function getImage(data,) { //查询巡检图片
  139. return new RequestFun().fetch(
  140. `/app/data/getImage`,
  141. 'GET',
  142. data,
  143. null,
  144. 'Blob'
  145. )
  146. }