user.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import request from '@/sheep/request';
  2. const UserApi = {
  3. // 修改基本信息
  4. updateUser: (data) => {
  5. return request({
  6. url: '/app-api/member/user/update',
  7. method: 'PUT',
  8. data,
  9. custom: {
  10. showSuccess: true,
  11. auth: true,
  12. },
  13. });
  14. },
  15. // 修改用户手机
  16. updateUserMobile: (data) => {
  17. return request({
  18. url: '/app-api/member/user/update-mobile',
  19. method: 'PUT',
  20. data,
  21. custom: {
  22. loadingMsg: '验证中',
  23. showSuccess: true,
  24. successMsg: '修改成功'
  25. },
  26. });
  27. },
  28. // 基于微信小程序的授权码,修改用户手机
  29. updateUserMobileByWeixin: (code) => {
  30. return request({
  31. url: '/app-api/member/user/update-mobile-by-weixin',
  32. method: 'PUT',
  33. data: {
  34. code
  35. },
  36. custom: {
  37. showSuccess: true,
  38. loadingMsg: '获取中',
  39. successMsg: '修改成功'
  40. },
  41. });
  42. },
  43. // 修改密码
  44. updateUserPassword: (data) => {
  45. return request({
  46. url: '/app-api/member/user/update-password',
  47. method: 'PUT',
  48. data,
  49. custom: {
  50. loadingMsg: '验证中',
  51. showSuccess: true,
  52. successMsg: '修改成功'
  53. },
  54. });
  55. },
  56. // 重置密码
  57. resetUserPassword: (data) => {
  58. return request({
  59. url: '/app-api/member/user/reset-password',
  60. method: 'PUT',
  61. data,
  62. custom: {
  63. loadingMsg: '验证中',
  64. showSuccess: true,
  65. successMsg: '修改成功'
  66. }
  67. });
  68. },
  69. };
  70. export default UserApi;