From b70843d1a27dea7201775005d39af7ce64f5e252 Mon Sep 17 00:00:00 2001 From: linju-json Date: Tue, 29 Jun 2021 18:07:04 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E5=9C=A8=E5=AE=89?= =?UTF-8?q?=E5=8D=9310=E4=BB=A5=E4=B8=8B=E8=AE=BE=E5=A4=87,=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E7=99=BB=E9=99=86=E8=8E=B7=E5=8F=96=E4=B8=8D=E5=88=B0?= =?UTF-8?q?oaid=E4=BC=9A=E7=9B=B4=E6=8E=A5=E5=AF=BC=E8=87=B4=E7=99=BB?= =?UTF-8?q?=E9=99=86=E5=A4=B1=E8=B4=A5=E7=9A=84bug=202.=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DuniCloud=E7=89=88=E6=9C=AC=E4=B8=BA=E9=98=BF=E9=87=8C?= =?UTF-8?q?=E4=BA=91=E7=89=88=E6=97=B6=E5=88=A0=E9=99=A4=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=A4=B1=E8=B4=A5=EF=BC=8C=E8=85=BE=E8=AE=AF?= =?UTF-8?q?=E4=BA=91=E7=89=88=E5=88=A0=E9=99=A4=E5=A4=B4=E5=83=8F=E5=90=8E?= =?UTF-8?q?=E4=BA=8C=E6=AC=A1=E4=B8=8A=E4=BC=A0=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 3 ++ common/appInit.js | 30 ++++++++++++------ package.json | 2 +- pages/ucenter/userinfo/userinfo.vue | 31 +++++++++---------- uni_modules_tools/copy/manifest.json | 2 +- .../uni-config-center/uni-id/config.json | 2 +- 6 files changed, 42 insertions(+), 28 deletions(-) diff --git a/changelog.md b/changelog.md index de78e177..9a0c9b3f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +## 1.0.29(2021-06-29) +1. 修复在安卓10以下设备,操作登陆获取不到oaid会直接导致登陆失败的bug +2. 修复uniCloud版本为阿里云版时删除头像设置失败,腾讯云版删除头像后二次上传失败的问题 ## 1.0.28(2021-06-28) 修复云函数uni-id-cf的resetPwdBySmsCode接口,未注册过的用户也能调用的问题 ## 1.0.27(2021-06-25) diff --git a/common/appInit.js b/common/appInit.js index 42a4c60d..8b005efc 100644 --- a/common/appInit.js +++ b/common/appInit.js @@ -8,7 +8,6 @@ import interceptorChooseImage from '@/uni_modules/json-interceptor-chooseImage/j // #endif const db = uniCloud.database() export default function() { - // #ifndef H5 setTimeout(()=>{ // #endif @@ -80,7 +79,7 @@ export default function() { // console.log('getOAID success: '+JSON.stringify(e)); }, fail:function(e){ - fail() + callBack() console.log('getOAID failed: '+JSON.stringify(e)); } }); @@ -97,7 +96,7 @@ export default function() { // console.log('getOAID success: '+JSON.stringify(e)); }, fail:function(e){ - fail() + callBack() console.log('getOAID failed: '+JSON.stringify(e)); } }); @@ -105,11 +104,24 @@ export default function() { callBack() } }) + + let push_clientid = '', + idfa = plus.storage.getItem('idfa')||'';//idfa有需要的用户在应用首次启动时自己获取存储到storage中 + + try{ + push_clientid = plus.push.getClientInfo().clientid + }catch(e){ + uni.showModal({ + content: '获取推送标识失败。如果你的应用不需要推送功能,请注释掉本代码块', + showCancel: false, + confirmText:"好的" + }); + console.log(e) + } + let deviceInfo = { - "push_clientid":plus.push.getClientInfo().clientid,// 获取匿名设备标识符 - "imei":imei, - "oaid":oaid, - "idfa":plus.storage.getItem('idfa')||'' //idfa有需要的用户在应用首次启动时自己获取存储到storage中 + push_clientid,// 获取匿名设备标识符 + imei,oaid,idfa } console.log("重新登陆/注册,获取设备id",deviceInfo); option.data.deviceInfo = deviceInfo @@ -148,11 +160,11 @@ export default function() { }, fail(e) { // 失败回调拦截 if(Debug){ - console.log(e); uni.showModal({ - content: JSON.stringify(e), + content:JSON.stringify(e), showCancel: false }); + console.error(e); }else{ uni.showModal({ content: "系统错误请稍后再试!", diff --git a/package.json b/package.json index 90d1037c..a79f5181 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "id": "uni-starter", "displayName": "uni-starter", - "version": "1.0.28", + "version": "1.0.29", "description": "云端一体应用快速开发基本项目模版", "keywords": [ "uni-starter", diff --git a/pages/ucenter/userinfo/userinfo.vue b/pages/ucenter/userinfo/userinfo.vue index 363861e3..d7aa1be4 100644 --- a/pages/ucenter/userinfo/userinfo.vue +++ b/pages/ucenter/userinfo/userinfo.vue @@ -31,13 +31,6 @@ export default { data() { return { - avatar_file: { - "extname": "jpg", - "fileType": "image", - "name": "707756af-e9a9-4d08-8db9-5d1f34b84ea6.jpg", - "size": 98513, - "url": "cloud://tcb-lseqkmkcq0w1wzwcb18f3-be0d77.7463-tcb-lseqkmkcq0w1wzwcb18f3-be0d77-1304530278/1624523618672_0.jpg" - }, univerifyStyle: { authButton: { "title": "本机号码一键绑定", // 授权按钮文案 @@ -62,12 +55,13 @@ ...mapGetters({ userInfo: 'user/info', login: 'user/hasLogin' - }) + }), + avatar_file(){ + if(this.userInfo.avatar_file&&this.userInfo.avatar_file.url){ + return this.userInfo.avatar_file + } + } }, - onLoad() { - this.avatar_file = this.userInfo.avatar_file - console.log(this.avatar_file); - }, methods: { ...mapMutations({ setUserInfo: 'user/login' @@ -163,7 +157,13 @@ } }, removeAvatar(){ - this.setAvatarFile(null) + this.setAvatarFile({ + "extname": "jpg", + "fileType": "image", + "name": "", + "size": 0, + "url": "" + }) }, setAvatarFile(avatar_file){ uni.showLoading({ @@ -186,7 +186,6 @@ title: '删除成功' }) } - this.avatar_file = avatar_file this.setUserInfo({ avatar_file }); @@ -213,10 +212,10 @@ console.log(res); let tempFile = res.tempFiles[0], avatar_file = { - // #ifndef APP-PLUS + // #ifdef H5 extname:tempFile.name.split('.')[tempFile.name.split('.').length-1], // #endif - // #ifdef APP-PLUS + // #ifndef H5 extname:tempFile.path.split('.')[tempFile.path.split('.').length-1] // #endif }, diff --git a/uni_modules_tools/copy/manifest.json b/uni_modules_tools/copy/manifest.json index 14c5b65a..bace7b21 100644 --- a/uni_modules_tools/copy/manifest.json +++ b/uni_modules_tools/copy/manifest.json @@ -1,6 +1,6 @@ { "name" : "uni-starter", - "appid" : "__UNI__7D0D57D", + "appid" : "__UNI__E5373F7", "description" : "云端一体应用快速开发模版", "versionName" : "1.0.0", "versionCode" : "100", diff --git a/uni_modules_tools/copy/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json b/uni_modules_tools/copy/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json index 23349ef3..0c7975cf 100644 --- a/uni_modules_tools/copy/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json +++ b/uni_modules_tools/copy/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json @@ -24,7 +24,7 @@ "oauth": { "weixin": { "appid": "wx81dbb061d2258234", - "appsecret": "04478a5719d0ae70c7e3023bc8078410" + "appsecret": "51977820eb14cd71377d4048a1b4754e" } } }, -- GitLab