浏览代码

Merge branch 'fix_jb'

jwyu 1 年之前
父节点
当前提交
c4826b0441
共有 1 个文件被更改,包括 28 次插入18 次删除
  1. 28 18
      src/views/ppt_manage/newVersion/pptPublish.vue

+ 28 - 18
src/views/ppt_manage/newVersion/pptPublish.vue

@@ -513,27 +513,37 @@ export default {
       };
       };
 
 
       //console.log('pptx',pptx)
       //console.log('pptx',pptx)
+      //根据配置选择是走后端接口上传还是直接前端上传到oss
       pptx2.write('blob').then((data)=>{
       pptx2.write('blob').then((data)=>{
-        // let form = new FormData()
-        // form.append("file",data)
-        // form.append("PptId",this.$route.query.id) 
-        // pptInterface.uploadPPTXFile(form).then(res=>{
-        //   if(res.Ret===200){
-        //     this.publishPPT(res.Data.ResourceUrl)
-        //   }
-        // })
+        // 1走后端接口上传
+        const uploadType=this.$setting.dynamicOutLinks.PptUpdateApi ||
+                        this.$store.state.dynamicOutLinks.PptUpdateApi ||
+                        JSON.parse(localStorage.getItem('dynamicOutLinks')).PptUpdateApi
+        if(uploadType==1){
+          let form = new FormData()
+          form.append("file",data)
+          form.append("PptId",this.$route.query.id) 
+          pptInterface.uploadPPTXFile(form).then(res=>{
+            if(res.Ret===200){
+              this.publishPPT(res.Data.ResourceUrl)
+            }
+          })
+          return
+        }
+
+        
         // 上传到阿里云oss
         // 上传到阿里云oss
         // this.handleUploadToOSS(data)
         // this.handleUploadToOSS(data)
-        let clientType = this.$setting.dynamicOutLinks.ObjectStorageClient ||
-                        this.$store.state.dynamicOutLinks.ObjectStorageClient ||
-                        JSON.parse(localStorage.getItem('dynamicOutLinks')).ObjectStorageClient
-        // 上传到 对象存储器
-        uploadFileDirect(clientType,data,temName,options).then(url=>{
-          console.log('文件地址',url);
-          this.publishPPT(url)
-        }).catch(err=>{
-          console.error(err);
-        })
+        // let clientType = this.$setting.dynamicOutLinks.ObjectStorageClient ||
+        //                 this.$store.state.dynamicOutLinks.ObjectStorageClient ||
+        //                 JSON.parse(localStorage.getItem('dynamicOutLinks')).ObjectStorageClient
+        // // 上传到 对象存储器
+        // uploadFileDirect(clientType,data,temName,options).then(url=>{
+        //   console.log('文件地址',url);
+        //   this.publishPPT(url)
+        // }).catch(err=>{
+        //   console.error(err);
+        // })
       })
       })
     },
     },
     //计算各版式下,对应position在ppt中的位置
     //计算各版式下,对应position在ppt中的位置