member.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import { requestApi } from '../util/network'
  2. // 用户退出登录
  3. export const logout =
  4. (username) =>
  5. requestApi(
  6. '/Logout/index',
  7. 'POST',
  8. {
  9. username: username,
  10. client: 'wap'
  11. },
  12. 'member'
  13. )
  14. // 获取用户首页信息
  15. export const getMemberIndex =
  16. () =>
  17. requestApi(
  18. '/Member/index',
  19. 'POST',
  20. {
  21. },
  22. 'member'
  23. )
  24. // 获取用户基本信息
  25. export const getMemberInfo =
  26. () =>
  27. requestApi(
  28. '/Member/information',
  29. 'POST',
  30. {
  31. },
  32. 'member'
  33. )
  34. // 更新用户基本信息
  35. export const updateMemberInfo =
  36. (memberInfo) =>
  37. requestApi(
  38. '/Member/edit_information',
  39. 'POST',
  40. {
  41. member_nickname: memberInfo.member_nickname,
  42. member_qq: memberInfo.member_qq,
  43. member_ww: memberInfo.member_ww,
  44. member_birthday: memberInfo.member_birthday
  45. },
  46. 'member'
  47. )
  48. // 更新用户头像
  49. export const uploadMemberAvatar =
  50. (file) =>
  51. requestApi(
  52. '/Member/edit_memberavatar',
  53. 'POST',
  54. file,
  55. 'member',
  56. true
  57. )
  58. export const uploadAuth =
  59. (file) =>
  60. requestApi(
  61. '/Member/edit_auth',
  62. 'POST',
  63. file,
  64. 'member',
  65. true
  66. )
  67. export const dropAuth =
  68. (file_name) =>
  69. requestApi(
  70. '/Member/drop_auth',
  71. 'POST',
  72. {
  73. file_name: file_name
  74. },
  75. 'member'
  76. )
  77. export const updateMemberAuth =
  78. (memberTruename, memberIdcard, ifConfirm) =>
  79. requestApi(
  80. '/Member/auth',
  81. 'POST',
  82. {
  83. member_truename: memberTruename,
  84. member_idcard: memberIdcard,
  85. if_confirm: ifConfirm
  86. },
  87. 'member'
  88. )
  89. //获取商品海报
  90. export const goodsPoster =
  91. (goods_id) =>
  92. requestApi(
  93. '/Member/goods_poster',
  94. 'POST',
  95. {
  96. goods_id: goods_id
  97. },
  98. 'member'
  99. )