user.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. import request from '@/sheep/request';
  2. const UserApi = {
  3. // 获得基本信息
  4. getUserInfo: () => {
  5. return request({
  6. url: '/member/user/get',
  7. method: 'GET',
  8. custom: {
  9. showLoading: false,
  10. auth: true,
  11. },
  12. });
  13. },
  14. // 修改基本信息
  15. updateUser: (data) => {
  16. return request({
  17. url: '/member/user/update',
  18. method: 'PUT',
  19. data,
  20. custom: {
  21. auth: true,
  22. showSuccess: true,
  23. successMsg: '更新成功'
  24. },
  25. });
  26. },
  27. updateUserAlipayAccount: (data) => {
  28. return request({
  29. url: '/member/user/updateByAlipayAccount',
  30. method: 'PUT',
  31. data,
  32. custom: {
  33. auth: true,
  34. showSuccess: true,
  35. successMsg: '更新成功'
  36. },
  37. });
  38. },
  39. updateUserBankAccount: (data) => {
  40. return request({
  41. url: '/member/user/updateByBankAccount',
  42. method: 'PUT',
  43. data,
  44. custom: {
  45. auth: true,
  46. showSuccess: true,
  47. successMsg: '更新成功'
  48. },
  49. });
  50. },
  51. // 修改用户手机
  52. updateUserMobile: (data) => {
  53. return request({
  54. url: '/member/user/update-mobile',
  55. method: 'PUT',
  56. data,
  57. custom: {
  58. loadingMsg: '验证中',
  59. showSuccess: true,
  60. successMsg: '修改成功'
  61. },
  62. });
  63. },
  64. // 基于微信小程序的授权码,修改用户手机
  65. updateUserMobileByWeixin: (code) => {
  66. return request({
  67. url: '/member/user/update-mobile-by-weixin',
  68. method: 'PUT',
  69. data: {
  70. code
  71. },
  72. custom: {
  73. showSuccess: true,
  74. loadingMsg: '获取中',
  75. successMsg: '修改成功'
  76. },
  77. });
  78. },
  79. // 修改密码
  80. updateUserPassword: (data) => {
  81. return request({
  82. url: '/member/user/update-password',
  83. method: 'PUT',
  84. data,
  85. custom: {
  86. loadingMsg: '验证中',
  87. showSuccess: true,
  88. successMsg: '修改成功'
  89. },
  90. });
  91. },
  92. // 重置密码
  93. resetUserPassword: (data) => {
  94. return request({
  95. url: '/member/user/reset-password',
  96. method: 'PUT',
  97. data,
  98. custom: {
  99. loadingMsg: '验证中',
  100. showSuccess: true,
  101. successMsg: '修改成功'
  102. }
  103. });
  104. },
  105. // 更新安卓用户的极光id
  106. updateAndroidJiGuangId: (registerId) => {
  107. return request({
  108. url: '/member/user/addRegisterId?registerId='+registerId,
  109. method: 'PUT',
  110. custom: {
  111. showSuccess: false,
  112. }
  113. });
  114. },
  115. };
  116. export default UserApi;