From e8e6e4fdb46947119d143a121039fd791ea7c99d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=B5=E5=96=B5=E5=96=B51234?= <396316021@qq.com> Date: Sat, 21 Oct 2023 17:19:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A5=E5=8F=8A=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=90=88=E5=B9=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/functions.js | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/utils/functions.js b/utils/functions.js index c97c2e9..873c31c 100644 --- a/utils/functions.js +++ b/utils/functions.js @@ -329,47 +329,6 @@ const api = { resolve(data); }) }, - uploadOssFile:(file)=>{ - return new Promise((resolve, reject) => { - getSTS({}).then(res => { - // const client = new OSS(res.data); - // console.log(file); - uni.showLoading({ - title:'上传中' - }) - let timer = new Date(); - let address = timer.getFullYear() + '' + (timer.getMonth() + 1) + '' + timer.getDate(); - address = 'upload/' + address + '/'; - var imageSrc = file; - let str = file.substr(file.lastIndexOf('.')); - let nameStr = address + timer.getTime() + str; - uni.uploadFile({ - url: `${oss}`, //仅为示例,非真实的接口地址 - filePath:file, - name: 'file', - header: { - "content-type": "application/json;charset=utf-8", - }, - formData:Object.assign({ - name:nameStr, - key:nameStr, - success_action_status: '200', - },res.data), - success: (uploadFileRes) => { - uni.hideLoading() - resolve ({show_path:oss+'/' + nameStr}); - // relove(JSON.parse(uploadFileRes.data).data) - // console.log(JSON.parse(uploadFileRes.data).data); - }, - fail:(res) =>{ - uni.hideLoading() - console.log(res) - return {}; - } - }); - }); - }) - }, logout:(reLaunch = true,confirm = true) => { return new Promise((resolve, reject) => { if(confirm){