index.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import request from '@/utils/request'
  2. class ShortVideoApi {
  3. /** 查询短视频列表 */
  4. getList(query) {
  5. return request({
  6. url: 'pc/teachingDsp/dsp/list',
  7. method: 'get',
  8. params: {
  9. status: 0,
  10. ...query
  11. }
  12. })
  13. }
  14. /** 查询短视频详情 */
  15. getVideoInfo(Id) {
  16. return request({
  17. url: 'pc/teachingDsp/dsp/' + Id,
  18. method: 'get'
  19. })
  20. }
  21. /** 新增短视频 */
  22. addVideo(data) {
  23. return request({
  24. url: 'pc/teachingDsp/dsp',
  25. method: 'post',
  26. data: data
  27. })
  28. }
  29. /** 修改短视频信息 */
  30. updateVideo(data) {
  31. return request({
  32. url: 'pc/teachingDsp/dsp',
  33. method: 'put',
  34. data: data
  35. })
  36. }
  37. /** 删除短视频 */
  38. delVideo(ids) {
  39. return request({
  40. url: 'pc/teachingDsp/dsp/' + ids,
  41. method: 'put'
  42. })
  43. }
  44. /** 上传视频封面 */
  45. uploadCover(data, fn) {
  46. return request({
  47. url: 'pc/teachingDsp/dsp/coverUp',
  48. method: 'put',
  49. headers: {
  50. 'content-type': 'multipart/form-data'
  51. },
  52. data,
  53. onUploadProgress: fn,
  54. timeout: 0
  55. })
  56. }
  57. /** 修改上架状态 */
  58. changeUserStatus(id, shelfStatus) {
  59. if (shelfStatus != 0) {
  60. return request({
  61. url: 'pc/teachingDsp/dsp/offShelf/' + id,
  62. method: 'put'
  63. })
  64. } else {
  65. return request({
  66. url: 'pc/teachingDsp/dsp/putShelf/' + id,
  67. method: 'put'
  68. })
  69. }
  70. }
  71. }
  72. export default new ShortVideoApi()