浏览代码

分离出 /categories 和 /region 接口, 前者在视频页面用于获取分区下的视频, 后者在视频发布页面用于获取视频分区

reghao 2 年之前
父节点
当前提交
8dca1ece9a
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 4 4
      src/api/video.js
  2. 2 2
      src/components/upload/PublishVideo.vue

+ 4 - 4
src/api/video.js

@@ -10,8 +10,8 @@ const videoApi = {
   videoResourceApi: '/api/content/post/video/resource',
   convertVideoApi: '/api/content/post/video/convert',
 
-  videoCategoryApi: '/api/content/video/region',
-  videoCategoriesApi: '/api/content/video/categories',
+  videoRegionApi: '/api/content/video/region',
+  videoCategoryApi: '/api/content/video/categories',
   categoryVideoApi: '/api/content/video/category',
   categoryShortVideoApi: '/api/content/video/category/short',
   userVideoPostApi: '/api/content/video/user',
@@ -88,8 +88,8 @@ export function convertVideo(videoId) {
 
 // *********************************************************************************************************************
 // 获取视频分类
-export function videoCategory() {
-  return get(videoApi.videoCategoryApi)
+export function videoRegion() {
+  return get(videoApi.videoRegionApi)
 }
 
 export function videoCategories() {

+ 2 - 2
src/components/upload/PublishVideo.vue

@@ -115,7 +115,7 @@
 
 <script>
 import { getServerInfo } from '@/api/content'
-import { videoCategory, addVideoPost } from '@/api/video'
+import { videoRegion, addVideoPost } from '@/api/video'
 
 export default {
   name: 'PublishVideo',
@@ -402,7 +402,7 @@ export default {
       }
     },
     getVideoCategory() {
-      videoCategory().then(res => {
+      videoRegion().then(res => {
         if (res.code === 0) {
           const resData = res.data
           for (let i = 0; i < resData.length; i++) {