diff --git a/changelog.md b/changelog.md index a35f33f1fe2fa286ce68f0fcc411030056d239aa..1865f12e156ac1acbc019c08a4fafb439897f361 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 a169cff782ce52467f06e51686298951c3aa2e05..ecde9761eae3824fd995fc044c850b213ba91371 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 e099d9ddd9bcd0949080868b1b1d59414b8d78d8..d79012dfc2838c14e9654dcc18982dec1ffa96c0 100644 --- a/manifest.json +++ b/manifest.json @@ -191,6 +191,13 @@ "base" : "" } }, - "_spaceID" : "", - "vueVersion" : "2" + "router": { + "base": "" + }, + "uniStatistics": { + "enable": true + } + }, + "_spaceID": "", + "vueVersion": "2" } diff --git a/package.json b/package.json index cbb0348ae3a15b55113d715c57d09c3826187dfe..87ac05a7af44eb91a13f1a2943eedcf07699d249 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 873f57e6cd95e92011116a52f0c61696f6d02841..2cf362805afa7a042dc7bdf56dfde9907e571f86 100644 --- a/pages/list/list.nvue +++ b/pages/list/list.nvue @@ -12,10 +12,9 @@ - + @@ -63,7 +62,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 +75,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: "", + where: '"article_status" == 1', keyword: "", refreshState: 0, 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 6b161253c7fa2ff16062ab1b3577d512b3b00d3c..a53b8c677f2d3b9800635e4d097508f7d4e059e9 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 f1de2beef7eaeed02b73fb24ceab2069d539e30f..a9f7f0136c46ca3fe9b31f41307e8130413286ef 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: { async submit(){ //完成并提交 diff --git a/pages/ucenter/settings/settings.vue b/pages/ucenter/settings/settings.vue index 65b9884034694224c0def740517f60059751f802..5bed04df5643bf60e466ba61a2053ab9527e44e5 100644 --- a/pages/ucenter/settings/settings.vue +++ b/pages/ucenter/settings/settings.vue @@ -185,22 +185,31 @@ clickLogout() { console.log("this.hasLogin:---------------- ",this.hasLogin); if (this.hasLogin) { - this.logout(); - uni.navigateBack(); - // uni.showModal({ - // title: this.$t('settings.tips'), - // content: this.$t('settings.exitLogin'), - // cancelText: this.$t('settings.cancelText'), - // confirmText: this.$t('settings.confirmText'), - // success: res => { - // if (res.confirm) { - // this.logout(); - // uni.navigateBack(); - // } - // }, - // fail: () => {}, - // complete: () => {} - // }); + uni.showModal({ + title: this.$t('settings.tips'), + content: this.$t('settings.exitLogin'), + cancelText: this.$t('settings.cancelText'), + confirmText: this.$t('settings.confirmText'), + success: res => { + 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: () => {}, + complete: () => {} + }); } else { uni.navigateTo({ url: '/pages/ucenter/login-page/index/index' diff --git a/uniCloud-aliyun/database/opendb-verify-codes.schema.json b/uniCloud-aliyun/database/opendb-verify-codes.schema.json index 50c27c6ae3cc4e90e90eede4d9ea1cd02385c8e9..8f86479d5508ed71158be14fe685a9e0c7de7b83 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 0000000000000000000000000000000000000000..1d1c81531decbffebf5aa7b3bacb9c149b79d158 --- /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" + } + } + } +}