user.js 1.3 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: 'put',
  12. data: data
  13. })
  14. }
  15. // 查询用户个人信息
  16. export function getUserProfile() {
  17. return request({
  18. url: '/system/user/profile',
  19. headers: {
  20. isClientId:true,
  21. },
  22. method: 'get'
  23. })
  24. }
  25. // 修改用户个人信息
  26. export function updateUserProfile(data) {
  27. return request({
  28. url: '/system/user/profile',
  29. method: 'put',
  30. data: data
  31. })
  32. }
  33. // 用户头像上传
  34. export function uploadAvatar(data) {
  35. return upload({
  36. url: '/system/user/profile/avatar',
  37. name: data.name,
  38. filePath: data.filePath
  39. })
  40. }
  41. // 用户照片上传
  42. export function uploadPerson(data) {
  43. return upload({
  44. url: '/common/upload',
  45. file:data.file
  46. })
  47. }
  48. // 音频生成接口
  49. export function audioCreateVideo(data) {
  50. return request({
  51. url: '/system/user/profile',
  52. headers: {
  53. isClientId:true,
  54. },
  55. method: 'post'
  56. })
  57. }
  58. // 文本生成接口
  59. export function textCreateVideo(data) {
  60. return request({
  61. url: '/system/user/profile',
  62. headers: {
  63. isClientId:true,
  64. },
  65. method: 'post'
  66. })
  67. }