my.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import {
  2. request
  3. } from '@/request/request.js';
  4. /*
  5. * 获取关注数量
  6. *
  7. *
  8. */
  9. export function getMyCount() {
  10. return request({
  11. url: `/api/fans/count`,
  12. method: 'get'
  13. })
  14. }
  15. /*
  16. * 获取用户信息
  17. *
  18. *
  19. */
  20. export function getUserInfoById(userId) {
  21. return request({
  22. url: `/manager/userInfo/${userId}`,
  23. method: 'get'
  24. })
  25. }
  26. /*
  27. * 用户是否关注
  28. *
  29. *
  30. */
  31. export function isFans(userId) {
  32. return request({
  33. url: `/api/fans/attention/${userId}`,
  34. method: 'get'
  35. })
  36. }
  37. /*
  38. * 关注用户
  39. *
  40. *
  41. */
  42. export function attention(userId) {
  43. return request({
  44. url: `/api/fans/${userId}`,
  45. method: 'get'
  46. })
  47. }
  48. /*
  49. * 取消关注
  50. *
  51. *
  52. */
  53. export function cancelAttention(userId) {
  54. return request({
  55. url: `/api/fans/${userId}`,
  56. method: 'delete'
  57. })
  58. }
  59. /*
  60. * 获取粉丝列表
  61. *
  62. *
  63. */
  64. export function getFansListByPage(currPage, pageSize) {
  65. return request({
  66. url: `/api/fans/${currPage}/${pageSize}`,
  67. method: 'get'
  68. })
  69. }
  70. /*
  71. * 获取关注列表
  72. *
  73. *
  74. */
  75. export function getFansAttentionListByPage(currPage, pageSize) {
  76. return request({
  77. url: `/api/fans/attention/${currPage}/${pageSize}`,
  78. method: 'get'
  79. })
  80. }