综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

user.js 994B

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