user.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import upload from '@/utils/upload'
  2. import request from '@/utils/request'
  3. // 用户密码修改
  4. export function updateUserPwd(oldPassword,newPassword) {
  5. const data = {
  6. oldPassword,
  7. newPassword
  8. }
  9. return request({
  10. url: '/system/user/profile/updatePwd',
  11. method: 'post',
  12. params: data
  13. })
  14. }
  15. // 上传图片
  16. export function uploadPhoto(data) {
  17. return upload({
  18. url: '/common/upload',
  19. name: data.name,
  20. filePath: data.filePath
  21. })
  22. }
  23. // 查询用户个人信息
  24. export function getUserProfile() {
  25. return request({
  26. url: '/system/user/profile',
  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. }
  46. // 获取部门
  47. export function gettreeselect(data) {
  48. return request({
  49. url: '/system/dept/treeselect',
  50. method: 'get',
  51. data: data
  52. })
  53. }
  54. //部门接口
  55. export function getfgwtreeFn(data) {
  56. return request({
  57. url: '/system/dept/fgw/treeselect',
  58. method: 'get',
  59. data:data
  60. })
  61. }
  62. // 下载版本更新
  63. export function findVersion(data) {
  64. return request({
  65. url: '/system/app/new',
  66. method: 'get',
  67. data: data
  68. })
  69. }