From ff1a1e5e01a4711dcba03bdb06a3e13b3c5c8895 Mon Sep 17 00:00:00 2001 From: linju-json Date: Wed, 29 Dec 2021 17:50:47 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E6=80=A7=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=8Clist=E9=A1=B5=E9=9D=A2=E4=BD=BF=E7=94=A8=EF=BC=8C[?= =?UTF-8?q?=E8=AF=A6=E6=83=85](https://uniapp.dcloud.io/uniCloud/unicloud-?= =?UTF-8?q?db=3Fid=3Dcollection)=20-=20=E6=8B=89=E9=BD=90uni-starter?= =?UTF-8?q?=E5=92=8Cuni-admin=E7=9A=84schema=E6=96=B0=E5=A2=9E=EF=BC=9Auni?= =?UTF-8?q?-id-tag.schema.json=EF=BC=8C=E6=9B=B4=E6=96=B0=EF=BC=9Aopendb-v?= =?UTF-8?q?erify-codes.schema.json=20-=20=E4=BF=AE=E5=A4=8D=E9=A6=96?= =?UTF-8?q?=E6=AC=A1=E7=99=BB=E9=99=86,=E7=94=A8=E6=88=B7id=E6=B2=A1?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E5=88=B0storage=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20-=20=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=89=A7=E8=A1=8C=E9=80=80?= =?UTF-8?q?=E5=87=BA=E7=99=BB=E9=99=86=E5=90=8E=EF=BC=8C=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E4=BA=91=E5=87=BD=E6=95=B0=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 5 ++ .../uni-quick-login/uni-quick-login.vue | 4 +- manifest.json | 3 + package.json | 2 +- pages/list/list.nvue | 18 ++-- .../login-page/common/login-page.mixin.js | 3 + .../login-page/phone-code/phone-code.vue | 4 +- pages/ucenter/settings/settings.vue | 17 +++- .../database/opendb-verify-codes.schema.json | 86 +++++++++---------- .../database/uni-id-tag.schema.json | 52 +++++++++++ 10 files changed, 137 insertions(+), 57 deletions(-) create mode 100644 uniCloud-aliyun/database/uni-id-tag.schema.json diff --git a/changelog.md b/changelog.md index a35f33f1..1865f12e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +## 1.1.26(2021-12-29) +- 性能优化,list页面使用`getTemp`,[详情](https://uniapp.dcloud.io/uniCloud/unicloud-db?id=collection) +- 拉齐uni-starter和uni-admin的schema新增:uni-id-tag.schema.json,更新:opendb-verify-codes.schema.json +- 修复首次登陆,用户id没存储到storage的问题 +- 新增:执行退出登陆后,通过云函数调用`uniID.logout` ## 1.1.25(2021-12-09) 修复H5端在about页面,返回触发`uniShare.hide()`引发报错 ## 1.1.24(2021-11-29) diff --git a/components/uni-quick-login/uni-quick-login.vue b/components/uni-quick-login/uni-quick-login.vue index a169cff7..ecde9761 100644 --- a/components/uni-quick-login/uni-quick-login.vue +++ b/components/uni-quick-login/uni-quick-login.vue @@ -354,7 +354,9 @@ return this.$refs.userProfile.open(result.uid) } // #endif - + if (result.type == "register") { + result.userInfo._id = result.uid + } this.setUserInfo(result.userInfo) loginSuccess(result) } else { diff --git a/manifest.json b/manifest.json index bf455fec..882d35b3 100644 --- a/manifest.json +++ b/manifest.json @@ -219,6 +219,9 @@ }, "router": { "base": "" + }, + "uniStatistics": { + "enable": true } }, "_spaceID": "", diff --git a/package.json b/package.json index 208bc6f5..6d4e4f30 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "id": "uni-starter", "displayName": "uni-starter", - "version": "1.1.25", + "version": "1.1.26", "description": "云端一体应用快速开发基本项目模版", "keywords": [ "login", diff --git a/pages/list/list.nvue b/pages/list/list.nvue index 1c8e0b33..f846f817 100644 --- a/pages/list/list.nvue +++ b/pages/list/list.nvue @@ -12,9 +12,9 @@ - + :collection="colList" :page-size="10" + > + @@ -63,7 +63,7 @@ import statusBar from "@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar"; import Gps from '@/uni_modules/json-gps/js_sdk/gps.js'; - const gps = new Gps() + const gps = new Gps(),db = uniCloud.database(); export default { components: { @@ -76,11 +76,17 @@ } else { return '请输入搜索内容' } + }, + colList(){ + return [ + db.collection('opendb-news-articles').where(this.where).field('avatar,title,last_modify_date,user_id').getTemp(), + db.collection('uni-id-users').field('_id,username').getTemp() + ] } }, data() { - return { - where: "", + return { + where: '"article_status" == 1', keyword: "", showRefresh: false, listHight: 0 diff --git a/pages/ucenter/login-page/common/login-page.mixin.js b/pages/ucenter/login-page/common/login-page.mixin.js index 6b161253..a53b8c67 100644 --- a/pages/ucenter/login-page/common/login-page.mixin.js +++ b/pages/ucenter/login-page/common/login-page.mixin.js @@ -8,6 +8,9 @@ let mixin = { loginSuccess(result){ loginSuccess(result) delete result.userInfo.token + if (result.type == "register") { + result.userInfo._id = result.uid + } this.setUserInfo(result.userInfo) } } diff --git a/pages/ucenter/login-page/phone-code/phone-code.vue b/pages/ucenter/login-page/phone-code/phone-code.vue index d08d5fe8..aca1de54 100644 --- a/pages/ucenter/login-page/phone-code/phone-code.vue +++ b/pages/ucenter/login-page/phone-code/phone-code.vue @@ -39,7 +39,9 @@ this.phone = phoneNumber; }, onReady() { - // this.$refs.sendSmsCode.start(); + if(this.phone.length==11){ + this.$refs.sendSmsCode.start(); + } }, methods: { submit(){ //完成并提交 diff --git a/pages/ucenter/settings/settings.vue b/pages/ucenter/settings/settings.vue index 5f7594f8..e206c023 100644 --- a/pages/ucenter/settings/settings.vue +++ b/pages/ucenter/settings/settings.vue @@ -187,9 +187,20 @@ cancelText: this.$t('settings.cancelText'), confirmText: this.$t('settings.confirmText'), success: res => { - if (res.confirm) { - this.logout(); - uni.navigateBack(); + if (res.confirm) { + uni.showLoading({ + mask: true + }); + uniCloud.callFunction({ + name:'uni-id-cf', + data:{action:'logout'}, + complete: (e) => { + console.log(e); + this.logout(); + uni.hideLoading() + uni.navigateBack(); + } + }) } }, fail: () => {}, diff --git a/uniCloud-aliyun/database/opendb-verify-codes.schema.json b/uniCloud-aliyun/database/opendb-verify-codes.schema.json index 50c27c6a..8f86479d 100644 --- a/uniCloud-aliyun/database/opendb-verify-codes.schema.json +++ b/uniCloud-aliyun/database/opendb-verify-codes.schema.json @@ -1,45 +1,41 @@ -{ - "bsonType": "object", - "required": [], - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "mobile": { - "bsonType": "string", - "description": "手机号码" - }, - "email": { - "bsonType": "string", - "description": "邮箱" - }, - "device_uuid": { - "bsonType": "string", - "description": "设备UUID,常用于图片验证码" - }, - "code": { - "bsonType": "string", - "description": "验证码" - }, - "scene": { - "bsonType": "string", - "description": "使用验证码的场景,如:login, bind, unbind, pay" - }, - "state": { - "bsonType": "int", - "description": "验证状态:0 未验证、1 已验证、2 已作废" - }, - "ip": { - "bsonType": "string", - "description": "请求时客户端IP地址" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间" - }, - "expired_date": { - "bsonType": "timestamp", - "description": "过期时间" - } - } -} \ No newline at end of file +{ + "bsonType": "object", + "required": [], + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "mobile": { + "bsonType": "string", + "description": "手机号码" + }, + "email": { + "bsonType": "string", + "description": "邮箱" + }, + "code": { + "bsonType": "string", + "description": "验证码" + }, + "type": { + "bsonType": "string", + "description": "验证类型:login, bind, unbind, pay" + }, + "state": { + "bsonType": "int", + "description": "验证状态:0 未验证、1 已验证、2 已作废" + }, + "ip": { + "bsonType": "string", + "description": "请求时客户端IP地址" + }, + "created_at": { + "bsonType": "timestamp", + "description": "创建时间" + }, + "expired_at": { + "bsonType": "timestamp", + "description": "过期时间" + } + } +} diff --git a/uniCloud-aliyun/database/uni-id-tag.schema.json b/uniCloud-aliyun/database/uni-id-tag.schema.json new file mode 100644 index 00000000..1d1c8153 --- /dev/null +++ b/uniCloud-aliyun/database/uni-id-tag.schema.json @@ -0,0 +1,52 @@ +{ + "bsonType": "object", + "required": ["tagid", "name"], + "permission": { + "read": false, + "create": false, + "update": false, + "delete": false + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "tagid": { + "bsonType": "string", + "description": "标签tagid", + "label": "标签tagid", + "componentForEdit": { + "name": "uni-easyinput" + } + }, + "name": { + "bsonType": "string", + "description": "标签名称", + "label": "标签名称", + "componentForEdit": { + "name": "uni-easyinput" + } + }, + "description": { + "bsonType": "string", + "description": "标签描述", + "label": "标签描述", + "componentForEdit": { + "name": "textarea" + }, + "componentForShow": { + "name": "textarea" + } + }, + "create_date": { + "bsonType": "timestamp", + "label": "创建时间", + "forceDefaultValue": { + "$env": "now" + }, + "componentForEdit": { + "name": "uni-dateformat" + } + } + } +} -- GitLab