data.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import request from '@/utils/request';
  2. import { AxiosPromise } from 'axios';
  3. export const getpassenger = () => {
  4. return request({
  5. url: '/statistic/passenger/flow',
  6. method: 'get'
  7. });
  8. };
  9. export const getInfo = (code) => {
  10. return request({
  11. url: '/system/common/cabinet/' + code + '/info',
  12. method: 'post'
  13. });
  14. }
  15. export const getInfoWait = async (code) => {
  16. const res = await request({
  17. url: '/system/common/cabinet/' + code + '/info',
  18. method: 'post'
  19. });
  20. if (res.code === 200) {
  21. return res.data;
  22. }
  23. return Promise.reject(new Error(res.message));
  24. }
  25. export const getBoxInfo = (code) => {
  26. return request({
  27. url: '/system/common/cabinet/' + code + '/allbox/info',
  28. method: 'post'
  29. });
  30. }
  31. export const getLock = (code, lockAddress) => {
  32. return request({
  33. url: '/system/common/cabinet/' + code + '/openlock/' + lockAddress,
  34. method: 'post'
  35. });
  36. }
  37. export const openall = (code) => {
  38. return request({
  39. url: '/system/common/cabinet/' + code + '/lock/openall',
  40. method: 'post'
  41. });
  42. }
  43. // export const openall = (code) =>{
  44. // return request({
  45. // url: '/system/common/cabinet/{code}/box/{boxuuid}/clear',
  46. // method: 'post'
  47. // });
  48. // }
  49. // export const openall = (code) =>{
  50. // return request({
  51. // url: '/system/common/cabinet/{code}/box/{boxuuid}/openclear',
  52. // method: 'post'
  53. // });
  54. // }