diff --git a/uni_modules/uni-id-pages/changelog.md b/uni_modules/uni-id-pages/changelog.md
index cf56b7dcd95348865c69b67c4906d2b5efb61a55..5c38e1a2e42c83b48ca6db3ccfd57959c3b243f3 100644
--- a/uni_modules/uni-id-pages/changelog.md
+++ b/uni_modules/uni-id-pages/changelog.md
@@ -1,3 +1,8 @@
+## 1.0.25(2022-10-14)
+- uni-id-co 增加 微信授权手机号登录方式 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin-mobile)
+- uni-id-co 增加 解绑第三方平台账号 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-third-account)
+- uni-id-co 微信绑定手机号支持通过`getPhoneNumber`事件回调的`code`绑定 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-mobile-by-mp-weixin)
+- 修复 sendSmsCode 接口未在参数内传递 templateId 时 未能从配置文件读取 templateId 的Bug
## 1.0.24(2022-10-08)
- 修复 报uni-id-users表schema内错误的bug
## 1.0.23(2022-10-08)
diff --git a/uni_modules/uni-id-pages/common/store.js b/uni_modules/uni-id-pages/common/store.js
index 223b90407e2ab54fbb973070f2b9c64bc98a94de..1c1d075810f163e2ad0feadc309f89f7c2972c7e 100644
--- a/uni_modules/uni-id-pages/common/store.js
+++ b/uni_modules/uni-id-pages/common/store.js
@@ -1,22 +1,22 @@
import pagesJson from '@/pages.json'
const uniIdCo = uniCloud.importObject("uni-id-co")
-const db = uniCloud.database();
+const db = uniCloud.database();
const usersTable = db.collection('uni-id-users')
-
-let hostUserInfo = uni.getStorageSync('uni-id-pages-userInfo')||{}
-console.log( hostUserInfo);
-const data = {
- userInfo: hostUserInfo,
- hasLogin: Object.keys(hostUserInfo).length != 0
-}
-
-console.log('data', data);
-// 定义 mutations, 修改属性
-export const mutations = {
- // data不为空,表示传递要更新的值(注意不是覆盖是合并),什么也不传时,直接查库获取更新
- async updateUserInfo(data = false) {
+
+let hostUserInfo = uni.getStorageSync('uni-id-pages-userInfo')||{}
+console.log( hostUserInfo);
+const data = {
+ userInfo: hostUserInfo,
+ hasLogin: Object.keys(hostUserInfo).length != 0
+}
+
+console.log('data', data);
+// 定义 mutations, 修改属性
+export const mutations = {
+ // data不为空,表示传递要更新的值(注意不是覆盖是合并),什么也不传时,直接查库获取更新
+ async updateUserInfo(data = false) {
if (data) {
usersTable.where('_id==$env.uid').update(data).then(e => {
console.log(e);
@@ -32,32 +32,32 @@ export const mutations = {
icon: 'none'
});
}
- })
-
- } else {
+ })
+
+ } else {
try {
let res = await usersTable.where("'_id' == $cloudEnv_uid")
.field('mobile,nickname,username,email,avatar_file')
- .get()
- console.log('fromDbData',res.result.data);
- this.setUserInfo(res.result.data[0])
- } catch (e) {
- this.setUserInfo({},{cover:true})
- console.error(e.message, e.errCode);
- }
- }
- },
- async setUserInfo(data, {cover}={cover:false}) {
+ .get()
+ console.log('fromDbData',res.result.data);
+ this.setUserInfo(res.result.data[0])
+ } catch (e) {
+ this.setUserInfo({},{cover:true})
+ console.error(e.message, e.errCode);
+ }
+ }
+ },
+ async setUserInfo(data, {cover}={cover:false}) {
console.log('set-userInfo', data);
let userInfo = cover?data:Object.assign(store.userInfo,data)
- store.userInfo = Object.assign({},userInfo)
- store.hasLogin = Object.keys(store.userInfo).length != 0
- console.log('store.userInfo', store.userInfo);
- uni.setStorage({
- key: "uni-id-pages-userInfo",
- data:store.userInfo
- })
- return data
+ store.userInfo = Object.assign({},userInfo)
+ store.hasLogin = Object.keys(store.userInfo).length != 0
+ console.log('store.userInfo', store.userInfo);
+ uni.setStorage({
+ key: "uni-id-pages-userInfo",
+ data:store.userInfo
+ })
+ return data
},
async logout() {
await uniIdCo.logout()
@@ -69,7 +69,7 @@ export const mutations = {
uni.$emit('uni-id-pages-logout')
this.setUserInfo({},{cover:true})
},
- loginSuccess(e){
+ loginSuccess(e = {}){
const {
showToast = true, toastText = '登录成功', autoBack = true, uniIdRedirectUrl = ''
} = e
@@ -106,32 +106,32 @@ export const mutations = {
return window.history.go(-3)
}
// #endif
-
+
if (delta) {
const page = pagesJson.pages[0]
return uni.reLaunch({
url: `/${page.path}`
})
}
-
+
uni.navigateBack({
delta
})
}
}
-
-}
-
-// #ifdef VUE2
-import Vue from 'vue'
-// 通过Vue.observable创建一个可响应的对象
-export const store = Vue.observable(data)
-// #endif
-
-// #ifdef VUE3
-import {
- reactive
-} from 'vue'
-// 通过Vue.observable创建一个可响应的对象
-export const store = reactive(data)
+
+}
+
+// #ifdef VUE2
+import Vue from 'vue'
+// 通过Vue.observable创建一个可响应的对象
+export const store = Vue.observable(data)
+// #endif
+
+// #ifdef VUE3
+import {
+ reactive
+} from 'vue'
+// 通过Vue.observable创建一个可响应的对象
+export const store = reactive(data)
// #endif
diff --git a/uni_modules/uni-id-pages/package.json b/uni_modules/uni-id-pages/package.json
index 169e5e730b473ffdb3e6ab1ab5754f158560443f..e993a3c43482ca3e35ed92f6700907878b1ad0cc 100644
--- a/uni_modules/uni-id-pages/package.json
+++ b/uni_modules/uni-id-pages/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-id-pages",
"displayName": "uni-id-pages",
- "version": "1.0.24",
+ "version": "1.0.25",
"description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [
"用户管理",
diff --git a/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue b/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
index 60c2e72fa6d947423543c8618597988bf38599e5..9fb17c91b0cbf04a5f62f13372eb6f22cf6b10af 100644
--- a/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
+++ b/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
@@ -14,16 +14,6 @@
-
-
-
-
-
-
diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
index f918c2657d779b17e79925bb290471061a9af8c5..2277a0d14b7fe5cf8ea7fe82f6d9b92fca43c8a3 100644
--- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
+++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json
@@ -1,6 +1,6 @@
{
"name": "uni-id-co",
- "version": "1.0.22",
+ "version": "1.0.25",
"description": "",
"main": "index.js",
"keywords": [],
@@ -16,4 +16,4 @@
"extensions": {
"uni-cloud-sms": {}
}
-}
\ No newline at end of file
+}