user.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. androidbuyVip: data => request('/order/appCreate', 'post', data, true),
  21. // 支付宝支付
  22. aliPay: data => request('/mobile/aliPay/pay', 'post', data, true),
  23. //获取是否vip及过期时间
  24. getVipInfo: data => request('/auth', 'get', data),
  25. //获取自己朗读的作品
  26. getSelfRead: data => request('/userRead/my', 'get', data),
  27. //获取其他用户朗读的作品
  28. getUserRead: data => request('/userRead', 'get', data),
  29. // 获取用户关注列表 type:1我的关注;2我的粉丝 ;3相互关注
  30. getFansList: data => request('/fans/myFriend', 'get', data),
  31. // 加关注请求类型为post,取消关注为put
  32. setFans: (data, method = 'post') => request('/fans', method, data),
  33. // 搜索用户
  34. getOtherUser: data => request('/v3/user/query', 'get', data),
  35. // 获取收藏列表
  36. getFavoritesList: data => request('/favorites', 'get', data),
  37. // 用code获取手机号
  38. exchangemobile: data => request('/v3/user/phoneNumber', 'get', data),
  39. // 绑定手机号
  40. bindPhone: data => request('/v3/user/bindMobile', 'post', data),
  41. // 获取邀请的用户列表
  42. getInviteList: data => request('/v3/user/invite', 'get', data),
  43. // 绑定音箱端
  44. bindDevice: data => request('/v3/user/deviceCode', 'post', data),
  45. // 获取公众号二维码(携带用户uid)
  46. getWxQrcode: data => request('/v3/user/showqrcode', 'get', data),
  47. }