综合办公系统
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.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import upload from '@/utils/upload'
  2. import request from '@/utils/request'
  3. import { parseStrEmpty } from '@/utils/common.js'
  4. // 查询用户列表
  5. export function listUser(query) {
  6. return request({
  7. url: '/system/user/list',
  8. method: 'get',
  9. params: query
  10. })
  11. }
  12. // 查询用户变更信息
  13. export function getUserChangeInfo(query) {
  14. return request({
  15. url: '/system/user/change',
  16. method: 'get',
  17. params: query
  18. })
  19. }
  20. // 新增用户
  21. export function addUser(data) {
  22. return request({
  23. url: '/system/user',
  24. method: 'post',
  25. data: data
  26. })
  27. }
  28. // 修改用户
  29. export function updateUser(data) {
  30. return request({
  31. url: '/system/user',
  32. method: 'put',
  33. data: data
  34. })
  35. }
  36. // 删除用户
  37. export function delUser(userId) {
  38. return request({
  39. url: '/system/user/' + userId,
  40. method: 'delete'
  41. })
  42. }
  43. // 用户密码重置
  44. export function updateUserPwd(oldPassword, newPassword) {
  45. const data = {
  46. oldPassword,
  47. newPassword
  48. }
  49. return request({
  50. url: '/system/user/profile/updatePwd',
  51. method: 'put',
  52. params: data
  53. })
  54. }
  55. // 查询用户个人信息
  56. export function getUserProfile() {
  57. return request({
  58. url: '/system/user/profile',
  59. method: 'get'
  60. })
  61. }
  62. // 查询用户详细
  63. export function getUser(userId) {
  64. return request({
  65. url: '/system/user/' + parseStrEmpty(userId),
  66. method: 'get'
  67. })
  68. }
  69. // 修改用户个人信息
  70. export function updateUserProfile(data) {
  71. return request({
  72. url: '/system/user/profile',
  73. method: 'put',
  74. data: data
  75. })
  76. }
  77. // 用户头像上传
  78. export function uploadAvatar(data) {
  79. return upload({
  80. url: '/system/user/profile/avatar',
  81. name: data.name,
  82. filePath: data.filePath
  83. })
  84. }