Forráskód Böngészése

使用 urlObjectName 表示视频原始文件在 OSS 中的 objectName

reghao 3 éve
szülő
commit
cfa0d41c31
1 módosított fájl, 5 hozzáadás és 4 törlés
  1. 5 4
      src/components/upload/publish-video.vue

+ 5 - 4
src/components/upload/publish-video.vue

@@ -149,8 +149,8 @@ export default {
         fileParameterName: 'file',
         testChunks: false,
         query: (file, chunk) => {
-          const key = 'video/playback/' + this.videoPost.videoUrlId
-          return { key: key }
+          this.videoPost.urlObjectName = 'video/playback/' + this.videoUrlId
+          return { key: this.videoPost.urlObjectName }
         },
         headers: {
         }
@@ -162,10 +162,11 @@ export default {
         value => !value || value.size < 2000000 || 'Avatar size should be less than 2 MB!'
       ],
       coverUrl: null,
+      videoUrlId: null,
       // 提交给后端的数据
       videoPost: {
         videoFileId: null,
-        videoUrlId: null,
+        urlObjectName: null,
         coverFileId: null,
         title: null,
         description: null,
@@ -478,7 +479,7 @@ export default {
           if (res.code === 0) {
             console.log(res.data)
             this.videoPost.videoFileId = res.data.videoFileId
-            this.videoPost.videoUrlId = res.data.videoUrlId
+            this.videoUrlId = res.data.videoUrlId
           } else {
             this.message = res.msg
             this.showMessage = true