user.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. }
  39. // 上传文件
  40. export function uploadFile(data) {
  41. return upload({
  42. url: '/infra/file/uploaData',
  43. method: 'PUT',
  44. name: data.name,
  45. filePath: data.filePath
  46. })
  47. }
  48. //获得员工信息根据id
  49. export function getEmployeeInfo(id) {
  50. return request({
  51. url: '/personnel/employee/get?id=' + id,
  52. method: 'get'
  53. })
  54. }