user.js 2.3 KB

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