From f897a7eba1c0d2162661d8d3cd058744aa2a0907 Mon Sep 17 00:00:00 2001 From: linju Date: Mon, 22 Aug 2022 18:09:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9A=E5=88=9A=E5=BE=AE=E4=BF=A1=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E4=B8=8A=E4=BC=A0=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uni-id-pages-user-profile/uni-id-pages-user-profile.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/uni_modules/uni-id-pages/components/uni-id-pages-user-profile/uni-id-pages-user-profile.vue b/uni_modules/uni-id-pages/components/uni-id-pages-user-profile/uni-id-pages-user-profile.vue index 80e326c..703f484 100644 --- a/uni_modules/uni-id-pages/components/uni-id-pages-user-profile/uni-id-pages-user-profile.vue +++ b/uni_modules/uni-id-pages/components/uni-id-pages-user-profile/uni-id-pages-user-profile.vue @@ -40,7 +40,7 @@ if(res.errMsg != "getUserProfile:ok"){ return this.closeMe() } - let {avatarUrl,nickName} = res.userInfo, cloudPath = userId+'/'+Date.now()+'avatarUrl.jpg'; + let {avatarUrl,nickName} = res.userInfo; let tempFilePath = await new Promise((callBack)=>{ uni.downloadFile({ @@ -60,6 +60,8 @@ } }); }) + const extName = tempFilePath.split('.').pop() || 'jpg' + const cloudPath = 'user/avatar/'+ userId+'/'+Date.now()+'-avatar.'+extName; // console.log(tempFilePath); const result = await uniCloud.uploadFile({ filePath: tempFilePath, -- GitLab