综合办公系统
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

user.js 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. import request from '@/utils/request'
  2. import { parseStrEmpty } from "@/utils/ruoyi";
  3. // 查询用户列表
  4. export function listUser(query) {
  5. return request({
  6. url: '/system/user/list',
  7. method: 'get',
  8. params: query
  9. })
  10. }
  11. // 查询用户详细
  12. export function getUser(userId) {
  13. return request({
  14. url: '/system/user/' + parseStrEmpty(userId),
  15. method: 'get'
  16. })
  17. }
  18. // 查询用户变更信息
  19. export function getUserChangeInfo(query) {
  20. return request({
  21. url: '/system/user/change',
  22. method: 'get',
  23. params: query
  24. })
  25. }
  26. // 新增用户
  27. export function addUser(data) {
  28. return request({
  29. url: '/system/user',
  30. method: 'post',
  31. data: data
  32. })
  33. }
  34. // 修改用户
  35. export function updateUser(data) {
  36. return request({
  37. url: '/system/user',
  38. method: 'put',
  39. data: data
  40. })
  41. }
  42. // 删除用户
  43. export function delUser(userId) {
  44. return request({
  45. url: '/system/user/' + userId,
  46. method: 'delete'
  47. })
  48. }
  49. // 用户密码重置
  50. export function resetUserPwd(userId, idCard, password) {
  51. const data = {
  52. userId,
  53. idCard,
  54. password
  55. }
  56. return request({
  57. url: '/system/user/resetPwd',
  58. method: 'put',
  59. data: data
  60. })
  61. }
  62. // 用户状态修改
  63. export function changeUserStatus(userId, status) {
  64. const data = {
  65. userId,
  66. status
  67. }
  68. return request({
  69. url: '/system/user/changeStatus',
  70. method: 'put',
  71. data: data
  72. })
  73. }
  74. // 查询用户个人信息
  75. export function getUserProfile() {
  76. return request({
  77. url: '/system/user/profile',
  78. method: 'get'
  79. })
  80. }
  81. // 修改用户个人信息
  82. export function updateUserProfile(data) {
  83. return request({
  84. url: '/system/user/profile',
  85. method: 'put',
  86. data: data
  87. })
  88. }
  89. // 用户密码重置
  90. export function updateUserPwd(oldPassword, newPassword) {
  91. const data = {
  92. oldPassword,
  93. newPassword
  94. }
  95. return request({
  96. url: '/system/user/profile/updatePwd',
  97. method: 'put',
  98. params: data
  99. })
  100. }
  101. // 用户头像上传
  102. export function uploadAvatar(data) {
  103. return request({
  104. url: '/system/user/profile/avatar',
  105. method: 'post',
  106. data: data
  107. })
  108. }
  109. // 查询授权角色
  110. export function getAuthRole(userId) {
  111. return request({
  112. url: '/system/user/authRole/' + userId,
  113. method: 'get'
  114. })
  115. }
  116. // 保存授权角色
  117. export function updateAuthRole(data) {
  118. return request({
  119. url: '/system/user/authRole',
  120. method: 'put',
  121. params: data
  122. })
  123. }
  124. // 查询部门下拉树结构
  125. export function deptTreeSelect() {
  126. return request({
  127. url: '/system/user/deptTree',
  128. method: 'get'
  129. })
  130. }
  131. // 查询部门下拉树结构
  132. export function deptTreeSelectNew() {
  133. return request({
  134. url: '/system/user/deptTreeNew',
  135. method: 'get'
  136. })
  137. }