Browse Source

no message

BF-202210271038\Administrator 2 years ago
parent
commit
dbf6f25e2c
2 changed files with 13 additions and 1 deletions
  1. 1 1
      pages/perfect/cards.vue
  2. 12 0
      service/tools.js

+ 1 - 1
pages/perfect/cards.vue

@@ -111,7 +111,7 @@ export default {
                   this.imgBg=imgUrl
                   this.imgBg=await cosServe.getSignUrl(this.imgBg)
                 }
-                this.imgList.push(imgUrl)
+                this.imgList.push(tools.setFileObj(imgUrl,1))
               })
             })
             console.log( this.imgList)

+ 12 - 0
service/tools.js

@@ -406,5 +406,17 @@ tools.getCosToken=function (){
         return undefined
     }
 }
+tools.setFileObj=function (url,type){
+    url= url.replace('https://','')
+    url= url.replace('http://','')
+    url= url.replace('icoco-1317650740.cos.ap-guangzhou.myqcloud.com/','')
+    return {
+        "location":url,
+        "hash":"abc123",
+        "version":"1.0",
+        "type":type===1?"PHOTO":"V",
+        "serverSideEncryption":"AES256"
+    }
+}
 
 export default tools