user.js 1.4 KB

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