user.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. import request from '~/utils/request'
  2. export const register = data => request({
  3. data,
  4. method: 'POST',
  5. url: 'register'
  6. })
  7. export const login = data => request({
  8. data,
  9. method: 'POST',
  10. url: 'login'
  11. })
  12. //更新用户信息
  13. export const updata = params => request({
  14. params,
  15. method: 'PUT',
  16. url: 'user'
  17. })
  18. export const mobileLogin = data => request({
  19. data,
  20. method: 'POST',
  21. url: 'mobile-login'
  22. })
  23. //用户信息
  24. export const userinfo = params => (request({
  25. params,
  26. method: 'GET',
  27. url: 'user/info'
  28. }))
  29. //我的关注
  30. export const follow = params => (request({
  31. params,
  32. method: 'GET',
  33. url: `user/follow`
  34. }))
  35. //粉丝列表
  36. export const fans = params => (request({
  37. params,
  38. method: 'GET',
  39. url: `user/fans`
  40. }))
  41. //关注
  42. export const userfollow = data => request({
  43. data,
  44. method: 'POST',
  45. url: `user/${data.id}/follow`
  46. })
  47. export const finance = () => (request({
  48. method: 'GET',
  49. url: 'finance'
  50. }))
  51. // 奖励
  52. // level/prize?page=1&limit=10&is_page=1
  53. export const levelPrize = params => request({
  54. params,
  55. method: 'GET',
  56. url: 'level/prize'
  57. })
  58. // 用户排名
  59. // user/rank?type=integral&page=1&limit=10&is_page=1
  60. export const userRank = params => request({
  61. url: 'user/rank',
  62. method: 'GET',
  63. params
  64. })
  65. // 优惠券
  66. // user/coupon?is_page=1&page=1&limit=10&is_expire=&is_use=&type=
  67. export const coupon = params => request({
  68. url: 'user/coupon',
  69. method: 'GET',
  70. params
  71. })
  72. //其他用户信息
  73. export const other = params => request({
  74. url: 'user/user/info',
  75. method: 'GET',
  76. params
  77. })
  78. //更换手机号
  79. export const phone = data => request({
  80. url: 'user/change-mobile',
  81. method: 'POST',
  82. data
  83. })
  84. //修改密码
  85. export const password = data => request({
  86. url: 'user/change-password',
  87. method: 'POST',
  88. data
  89. })
  90. //邀请列表
  91. export const children = params => request({
  92. url: 'user/children',
  93. method: 'GET',
  94. params
  95. })
  96. //邀请人信息
  97. export const parent = () => request({
  98. url: 'user/parent',
  99. method: 'GET',
  100. })
  101. //获取用户配置
  102. export const config = () => request({
  103. url: 'user/config',
  104. method: 'GET',
  105. })
  106. //设置用户配置
  107. export const postconfig = params => request({
  108. url: 'user/config',
  109. method: 'POST',
  110. params
  111. })
  112. //我的足迹
  113. export const browse = data => request({
  114. url: 'browse',
  115. method: 'GET',
  116. data
  117. })
  118. //勋章列表
  119. export const badge = data => request({
  120. url: 'badge',
  121. method: 'GET',
  122. data
  123. })