|
@@ -1,7 +1,9 @@
|
|
|
-import { get, post } from '@/utils/request'
|
|
|
|
|
|
|
+import { get, post, delete0 } from '@/utils/request'
|
|
|
|
|
|
|
|
const collectApi = {
|
|
const collectApi = {
|
|
|
collectVideoApi: '/api/content/collect/video',
|
|
collectVideoApi: '/api/content/collect/video',
|
|
|
|
|
+ deleteCollectApi: '/api/content/collect/video/delete',
|
|
|
|
|
+ eraseCollectApi: '/api/content/collect/video/erase',
|
|
|
userCollectionApi: '/api/content/collect/video',
|
|
userCollectionApi: '/api/content/collect/video',
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -10,6 +12,16 @@ export function collectVideo(data) {
|
|
|
return post(collectApi.collectVideoApi, data)
|
|
return post(collectApi.collectVideoApi, data)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 删除收藏
|
|
|
|
|
+export function deleteVideoCollection(videoId) {
|
|
|
|
|
+ return delete0(collectApi.deleteCollectApi + '/' + videoId)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 清空收藏夹
|
|
|
|
|
+export function eraseVideoCollection() {
|
|
|
|
|
+ return delete0(collectApi.eraseCollectApi)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 获取用户收藏
|
|
// 获取用户收藏
|
|
|
export function getUserCollection(pageNumber) {
|
|
export function getUserCollection(pageNumber) {
|
|
|
return get(collectApi.userCollectionApi + '?pageNumber=' + pageNumber)
|
|
return get(collectApi.userCollectionApi + '?pageNumber=' + pageNumber)
|