Sfoglia il codice sorgente

更新 EditVideo.vue

reghao 2 anni fa
parent
commit
2e7ef9d9c5
1 ha cambiato i file con 8 aggiunte e 7 eliminazioni
  1. 8 7
      src/components/upload/EditVideo.vue

+ 8 - 7
src/components/upload/EditVideo.vue

@@ -110,14 +110,15 @@ export default {
           }
         },
         headers: {
-          Authorization: 'Bearer '
-        }
+          Authorization: ''
+        },
+        withCredentials: true,
       },
       attrs: {
         accept: 'video/*'
       },
       imgHeaders: {
-        Authorization: 'Bearer '
+        Authorization: ''
       },
       imgData: {
         channelId: 3
@@ -168,6 +169,7 @@ export default {
     getServerInfo(2).then(res => {
       if (res.code === 0) {
         const resData = res.data
+        console.log(resData.token)
         this.options.target = resData.ossUrl
         this.options.chunkSize = resData.maxSize
         this.options.headers.Authorization = "Bearer " + resData.token
@@ -182,7 +184,7 @@ export default {
     }).catch(error => {
       this.$notify({
         title: '提示',
-        message: error.message,
+        message: '视频上传配置失败 ' + error.message,
         type: 'warning',
         duration: 3000
       })
@@ -190,8 +192,7 @@ export default {
 
     getServerInfo(5).then(res => {
       if (res.code === 0) {
-        this.imgHeaders.Authorization = 'Bearer ' + res.data
-        this.options.headers.Authorization = 'Bearer ' + res.data
+        this.imgHeaders.Authorization = 'Bearer ' + res.data.token
       } else {
         this.$notify({
           title: '提示',
@@ -203,7 +204,7 @@ export default {
     }).catch(error => {
       this.$notify({
         title: '提示',
-        message: error.message,
+        message: '图片上传配置失败 ' + error.message,
         type: 'warning',
         duration: 3000
       })