user.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. export function getTaskList() {
  29. return request({
  30. url: '/video/VideoTask/list',
  31. headers: {
  32. isClientId:true,
  33. },
  34. method: 'get',
  35. })
  36. }
  37. // 修改用户个人信息
  38. export function updateUserProfile(data) {
  39. return request({
  40. url: '/system/user/profile',
  41. headers: {
  42. isClientId:true,
  43. },
  44. method: 'put',
  45. data: data
  46. })
  47. }
  48. // 用户头像上传
  49. export function uploadAvatar(data) {
  50. return upload({
  51. url: '/system/user/profile/avatar',
  52. name: data.name,
  53. filePath: data.filePath
  54. })
  55. }
  56. // 用户照片上传
  57. export function uploadPerson(data) {
  58. return upload({
  59. url: '/common/upload',
  60. file:data.file
  61. })
  62. }
  63. // 音频生成接口
  64. export function audioCreateVideo(data) {
  65. return request({
  66. url: '/video/Videofile/createVideo',
  67. headers: {
  68. isClientId:true,
  69. },
  70. method: 'post',
  71. data:data
  72. })
  73. }
  74. // 文本生成接口
  75. export function textCreateVideo(data) {
  76. return request({
  77. url: '/video/Videofile/createVideo',
  78. headers: {
  79. isClientId:true,
  80. },
  81. method: 'post',
  82. data:data
  83. })
  84. }