user.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /** @format */
  2. import upload from "@/utils/upload";
  3. import request from "@/utils/request";
  4. // 用户密码重置
  5. export function updateUserPwd(oldPassword, newPassword) {
  6. const data = {
  7. oldPassword,
  8. newPassword,
  9. };
  10. return request({
  11. url: "/system/user/profile/updatePwd",
  12. method: "put",
  13. params: data,
  14. });
  15. }
  16. // 查询用户个人信息
  17. export function getUserProfile() {
  18. return request({
  19. url: "/system/user/profile",
  20. method: "get",
  21. });
  22. }
  23. // 修改用户个人信息
  24. export function updateUserProfile(data) {
  25. return request({
  26. url: "/system/user/profile",
  27. method: "put",
  28. data: data,
  29. });
  30. }
  31. // 用户头像上传
  32. export function uploadAvatar(data) {
  33. return upload({
  34. url: "/system/user/profile/avatar",
  35. name: data.name,
  36. filePath: data.filePath,
  37. });
  38. }
  39. //解除微信绑定
  40. export function unBindWeixin(params) {
  41. return request({
  42. url: "/api/miuser/unBindWx",
  43. method: "get",
  44. params,
  45. });
  46. }