user.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import {
  2. request
  3. } from "../utils/request";
  4. module.exports = {
  5. // 用户登录
  6. userLogin: data => request('/user/openId', 'get', data),
  7. // 统计用户登录
  8. loginLog: data => request('/loginLog', 'post', data),
  9. //获取他人用户信息,
  10. getUserInfo: data => request('/user/info', 'get', data),
  11. //获取用户信息
  12. getMyInfo: data => request('/v3/user/my', 'get', data),
  13. // 设置用户信息
  14. setUserInfo: (data, method = 'post') => request('/user', method, data),
  15. // 兑换激活码
  16. getLearnCard: data => request('/v3/learnCard/exchange', 'get', data, false, false),
  17. // 购买vip
  18. buyVip: data => request('/order', 'post', data, true),
  19. //获取是否vip及过期时间
  20. getVipInfo: data => request('/auth', 'get', data),
  21. //获取自己朗读的作品
  22. getSelfRead: data => request('/userRead/my', 'get', data),
  23. //获取其他用户朗读的作品
  24. getUserRead: data => request('/userRead', 'get', data),
  25. // 获取用户关注列表 type:1我的关注;2我的粉丝 ;3相互关注
  26. getFansList: data => request('/fans/myFriend', 'get', data),
  27. // 加关注请求类型为post,取消关注为put
  28. setFans: (data, method = 'post') => request('/fans', method, data),
  29. // 搜索用户
  30. getOtherUser: data => request('/v3/user/query', 'get', data),
  31. // 获取收藏列表
  32. getFavoritesList: data => request('/favorites', 'get', data),
  33. // 用code获取手机号
  34. exchangemobile: data => request('/v3/user/phoneNumber', 'get', data),
  35. // 绑定手机号
  36. bindPhone: data => request('/v3/user/bindMobile', 'post', data),
  37. // 获取邀请的用户列表
  38. getInviteList: data => request('/v3/user/invite', 'get', data),
  39. // 绑定音箱端
  40. bindDevice: data => request('/v3/user/deviceCode', 'post', data),
  41. // 获取公众号二维码(携带用户uid)
  42. getWxQrcode: data => request('/v3/user/showqrcode', 'get', data),
  43. }