user.js 836 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import upload from '@/utils/upload'
  2. import request from '@/utils/request'
  3. // 用户密码重置
  4. export function updateUserPwd(oldPassword, newPassword) {
  5. const data = {
  6. oldPassword,
  7. newPassword
  8. }
  9. return request({
  10. url: '/system/user/profile/update-password',
  11. method: 'put',
  12. params: data
  13. })
  14. }
  15. // 查询用户个人信息
  16. export function getUserProfile() {
  17. return request({
  18. url: '/system/user/profile/get',
  19. method: 'get'
  20. })
  21. }
  22. // 修改用户个人信息
  23. export function updateUserProfile(data) {
  24. return request({
  25. url: '/system/user/profile/update',
  26. method: 'put',
  27. data: data
  28. })
  29. }
  30. // 用户头像上传
  31. export function uploadAvatar(data) {
  32. return upload({
  33. url: '/system/user/profile/update-avatar',
  34. method: 'put',
  35. name: data.name,
  36. filePath: data.filePath
  37. })
  38. }