user.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. })