reghao 2 недель назад
Родитель
Сommit
735969e114
1 измененных файлов с 12 добавлено и 7 удалено
  1. 12 7
      src/views/post/VideoPostPublish.vue

+ 12 - 7
src/views/post/VideoPostPublish.vue

@@ -211,7 +211,7 @@ export default {
   },
   created() {
     this.initCategoryData()
-    this.initCoverUploadConfig()
+    this.initUploadConfig()
   },
   methods: {
     // 初始化编辑数据
@@ -242,20 +242,25 @@ export default {
       }
     },
 
-    async initCoverUploadConfig() {
+    initUploadConfig() {
       getVideoChannelInfo().then(resp => {
         if (resp.code === 0) {
           this.uploadConfig = resp.data
           this.uploadConfig.title = this.isEdit ? '重新上传视频文件' : '上传视频文件'
           this.uploadConfig.fileAttrs = { accept: 'video/*' }
+        } else {
+          this.$message.warning(resp.msg)
         }
       })
 
-      const res = await getVideoCoverChannelInfo()
-      if (res.code === 0) {
-        this.imgOssUrl = res.data.ossUrl
-        this.imgHeaders.Authorization = 'Bearer ' + res.data.token
-      }
+      getVideoCoverChannelInfo().then(res => {
+        if (res.code === 0) {
+          this.imgOssUrl = res.data.ossUrl
+          this.imgHeaders.Authorization = 'Bearer ' + res.data.token
+        } else {
+          this.$message.warning(res.msg)
+        }
+      })
     },
 
     // 2. 视频上传组件回调