user.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import upload from '@/utils/upload'
  2. import request from '@/utils/request'
  3. // 用户密码重置
  4. export function modifyPassword(data) {
  5. return request({
  6. url: '/sys/user/profile/modifyPassword',
  7. method: 'post',
  8. data: data
  9. })
  10. }
  11. export function add(data) {
  12. return request({
  13. url: '/sys/user/add',
  14. method: 'post',
  15. data: data
  16. })
  17. }
  18. export function edit(data) {
  19. return request({
  20. url: '/sys/user/edit',
  21. method: 'post',
  22. data: data
  23. })
  24. }
  25. export function deleteUser(data) {
  26. return request({
  27. url: '/sys/user/deleteUser',
  28. method: 'post',
  29. data: data
  30. })
  31. }
  32. // 查询用户个人信息
  33. export function getLoginUserInfo() {
  34. return request({
  35. url: '/sys/user/getLoginUser',
  36. method: 'get'
  37. })
  38. }
  39. export function list() {
  40. return request({
  41. url: '/sys/user/list',
  42. method: 'get'
  43. })
  44. }
  45. // 修改用户个人信息
  46. export function updateUserProfile(data) {
  47. return request({
  48. url: '/system/user/profile',
  49. method: 'put',
  50. data: data
  51. })
  52. }
  53. // 用户头像上传
  54. export function uploadAvatar(data) {
  55. return upload({
  56. url: '/system/user/profile/avatar',
  57. name: data.name,
  58. filePath: data.filePath
  59. })
  60. }
  61. export function checkUserAccountExist(data){
  62. return request({
  63. url: '/sys/user/checkUserAccount/'+data,
  64. method: 'get'
  65. })
  66. }