user.js 793 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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/updatePwd',
  11. method: 'put',
  12. params: data
  13. })
  14. }
  15. // 查询用户个人信息
  16. export function getUserProfile() {
  17. return request({
  18. url: '/system/user/profile',
  19. method: 'get'
  20. })
  21. }
  22. // 修改用户个人信息
  23. export function updateUserProfile(data) {
  24. return request({
  25. url: '/system/user/profile',
  26. method: 'put',
  27. data: data
  28. })
  29. }
  30. // 用户头像上传
  31. export function uploadAvatar(data) {
  32. return upload({
  33. url: '/system/user/profile/avatar',
  34. name: data.name,
  35. filePath: data.filePath
  36. })
  37. }