user.js 836 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. }