app.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import request from '@/sheep/request';
  2. export default {
  3. // 系统初始化
  4. init: (templateId) =>
  5. request({
  6. url: 'init',
  7. params: {
  8. templateId,
  9. },
  10. custom: {
  11. showError: false,
  12. showLoading: false,
  13. },
  14. }),
  15. // 同步客户端页面到后端
  16. pageSync: (pages) =>
  17. request({
  18. url: 'pageSync',
  19. method: 'POST',
  20. data: {
  21. pages,
  22. },
  23. custom: {
  24. showError: false,
  25. showLoading: false,
  26. },
  27. }),
  28. // 发送短信
  29. // TODO 芋艿:直接在 useModal 引入 AuthUtil 会报错,所以继续用这个 API
  30. sendSms: (mobile, scene) =>
  31. request({
  32. url: '/app-api/member/auth/send-sms-code',
  33. method: 'POST',
  34. data: {
  35. mobile,
  36. scene
  37. },
  38. custom: {
  39. showSuccess: true,
  40. loadingMsg: '发送中',
  41. },
  42. }),
  43. // 自定义页面
  44. page: (id) =>
  45. request({
  46. url: 'page/' + id,
  47. method: 'GET',
  48. }),
  49. //小程序直播
  50. mplive: {
  51. getRoomList: (ids) =>
  52. request({
  53. url: 'app/mplive/getRoomList',
  54. method: 'GET',
  55. params: {
  56. ids: ids.join(','),
  57. }
  58. }),
  59. getMpLink: () =>
  60. request({
  61. url: 'app/mplive/getMpLink',
  62. method: 'GET'
  63. }),
  64. },
  65. };