user.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. import request from '@/utils/request'
  2. import { praseStrEmpty } from "@/utils/huyi";
  3. // 查询用户列表
  4. export function listUser(query) {
  5. return request({
  6. url: '/system/ownUser/list',
  7. method: 'get',
  8. params: query
  9. })
  10. }
  11. // 查询用户详细
  12. export function getUser(userId) {
  13. return request({
  14. url: '/system/user/' + praseStrEmpty(userId),
  15. method: 'get'
  16. })
  17. }
  18. // 新增用户
  19. export function addUser(data) {
  20. return request({
  21. url: '/system/user',
  22. method: 'post',
  23. data: data
  24. })
  25. }
  26. // 修改用户
  27. export function updateUser(data) {
  28. return request({
  29. url: '/system/user',
  30. method: 'put',
  31. data: data
  32. })
  33. }
  34. export function delUser(userId) {
  35. return request({
  36. url: '/system/user/' + userId,
  37. method: 'delete'
  38. })
  39. }
  40. // 用户密码重置
  41. export function resetUserPwd(userId, password) {
  42. const data = {
  43. userId,
  44. password
  45. }
  46. return request({
  47. url: '/system/user/resetPwd',
  48. method: 'put',
  49. data: data
  50. })
  51. }
  52. // 用户状态修改
  53. export function changeUserStatus(userId, status) {
  54. const data = {
  55. userId,
  56. status
  57. }
  58. return request({
  59. url: '/system/user/changeStatus',
  60. method: 'put',
  61. data: data
  62. })
  63. }
  64. // 查询用户个人信息
  65. export function getUserProfile(sscDomain) {
  66. console.log(sscDomain)
  67. return request({
  68. url: '/system/user/profile/'+sscDomain,
  69. method: 'get'
  70. })
  71. }
  72. // 修改用户个人信息
  73. export function updateUserProfile(data) {
  74. return request({
  75. url: '/system/user/profile',
  76. method: 'put',
  77. data: data
  78. })
  79. }
  80. // 用户密码重置
  81. export function updateUserPwd(oldPassword, newPassword) {
  82. const data = {
  83. oldPassword,
  84. newPassword
  85. }
  86. return request({
  87. url: '/system/user/profile/updatePwd',
  88. method: 'put',
  89. params: data
  90. })
  91. }
  92. // 用户头像上传
  93. export function uploadAvatar(data) {
  94. return request({
  95. url: '/system/user/profile/avatar',
  96. method: 'post',
  97. data: data
  98. })
  99. }
  100. // 经办人申请变更
  101. export function handlerChange(data) {
  102. return request({
  103. url: '/system/ownUser/handlerChange',
  104. method: 'post',
  105. data: data
  106. })
  107. }
  108. //查询员工姓名
  109. export function nameList(userId) {
  110. return request({
  111. url: '/system/ownUser/listUser/'+ userId,
  112. method: 'get',
  113. })
  114. }
  115. //查询经办人变更图片
  116. export function getFund(userId) {
  117. return request({
  118. url: '/system/ownUser/details/'+ userId,
  119. method: 'get',
  120. })
  121. }
  122. //变更管理员角色
  123. export function adminChange(userId) {
  124. return request({
  125. url: '/system/ownUser/adminChange/'+ userId,
  126. method: 'post',
  127. })
  128. }
  129. // 查询当前用户
  130. export function getNowUser() {
  131. return request({
  132. url: '/system/ownUser/getNowUser',
  133. method: 'get'
  134. })
  135. }
  136. // 根据企业id获取部门与角色信息
  137. export function getRoleDept(companyId) {
  138. return request({
  139. url: '/system/user/getRoleDept/' + companyId,
  140. method: 'get'
  141. })
  142. }
  143. // 查询此用户下关联的企业
  144. export function companyList(userId) {
  145. return request({
  146. url: '/system/ownUser/' + praseStrEmpty(userId),
  147. method: 'get'
  148. })
  149. }
  150. // 根据手机号获取用户姓名
  151. export function selectNormalUser(userName) {
  152. const query = {userName : userName}
  153. return request({
  154. url: '/system/user/selectNormalUser',
  155. method: 'get',
  156. params: query
  157. })
  158. }