From 4959f6527a16b67d9b8b289b93388aee8d43e009 Mon Sep 17 00:00:00 2001 From: chenruilong Date: Fri, 5 May 2023 20:38:54 +0800 Subject: [PATCH] 1.1.12 --- manifest.json | 9 +++++---- uni_modules/uni-id-pages/changelog.md | 10 +++++++--- uni_modules/uni-id-pages/package.json | 2 +- .../cloudfunctions/uni-id-co/lib/utils/login.js | 6 +++--- .../uni-id-co/module/admin/add-user.js | 12 +++++++++++- .../facial-recognition-verify/get-auth-result.js | 1 + .../uni-id-co/module/relate/unbind-qq.js | 15 +-------------- .../uni-id-co/module/relate/unbind-weixin.js | 6 ++---- .../uni-id-co/module/verify/create-captcha.js | 5 +++-- .../uni-id-co/module/verify/refresh-captcha.js | 6 ++++-- 10 files changed, 38 insertions(+), 34 deletions(-) diff --git a/manifest.json b/manifest.json index 62aa7da..9938dff 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "uni-id-pages", - "appid" : "__UNI__HelloUniApp", + "appid" : "__UNI__ECAF623", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", @@ -18,7 +18,8 @@ }, /* 模块配置 */ "modules" : { - "OAuth" : {} + "OAuth" : {}, + "FacialRecognitionVerify": {} }, /* 应用发布信息 */ "distribute" : { @@ -57,7 +58,7 @@ "oauth" : { "univerify" : {}, "weixin" : { - "appid" : "", + "appid" : "wxffdd8fa6ec4ef2a0", "UniversalLinks" : "https://static-9f641af8-e860-44e5-b18f-f68dd8fe3fe4.bspapp.com/uni-universallinks/__UNI__0B1B311/" }, "apple" : {} @@ -107,7 +108,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "wx999bf02c8e05dfc9", + "appid" : "", "setting" : { "urlCheck" : false }, diff --git a/uni_modules/uni-id-pages/changelog.md b/uni_modules/uni-id-pages/changelog.md index fcf5c14..031c0c2 100644 --- a/uni_modules/uni-id-pages/changelog.md +++ b/uni_modules/uni-id-pages/changelog.md @@ -1,6 +1,10 @@ -## 1.1.12(2023-03-29) -- uni-id-co 修复 更新push_clientid时因device_id没有变化导致无法更新 -- uni-id-co 新增 自无unionid到有unionid状态进行登录时为用户补充unionid字段 +## 1.1.12(2023-05-05) +- uni-id-co 新增 调用 add-user 接口创建用户时允许触发 beforeRegister 钩子方法,beforeRegister 钩子[详见](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#before-register) +- uni-id-co 新增 自无 unionid 到有 unionid 状态进行登录时为用户补充 unionid 字段 +- uni-id-co 修复 i18n 在特定场景下报错的 bug +- uni-id-co 修复 跨平台解绑微信/QQ时无法解绑的 bug +- uni-id-co 修复 微信小程序等平台创建验证码时无法展示的 bug +- uni-id-co 修复 更新 push_clientid 时因 device_id 没有变化导致无法更新 ## 1.1.11(2023-03-24) - 修复 tabbar页面因为token无效而强制跳转至登录页面(url参数包含`uniIdRedirectUrl`)后无法返回的问题 ## 1.1.10(2023-03-24) diff --git a/uni_modules/uni-id-pages/package.json b/uni_modules/uni-id-pages/package.json index 1a5eb0a..21d6ae7 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.1.11", + "version": "1.1.12", "description": "云端一体简单、统一、可扩展的用户中心页面模版", "keywords": [ "用户管理", diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/login.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/login.js index 6ec8411..772d7c8 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/login.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/login.js @@ -173,8 +173,8 @@ async function thirdPartyLogin (params = {}) { user } = params return { - mobileComfirmd: user.mobile_comfirmd, - emailComfirmd: user.email_comfirmd + mobileConfirmed: !!user.mobile_confirmed, + emailConfirmed: !!user.email_confirmed } } @@ -194,7 +194,7 @@ async function postLogin (params = {}) { last_login_ip: clientIP, ...extraData } - const createTokenRes = await this.uniIdCommon.createToken({ + const createTokenRes = await this.uniIdCommon.createToken({ uid }) diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/add-user.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/add-user.js index 70aade3..d13369a 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/add-user.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/add-user.js @@ -113,7 +113,17 @@ module.exports = async function (params = {}) { data.mobile_confirmed = 1 } - await userCollection.add(data) + // 触发 beforeRegister 钩子 + const beforeRegister = this.hooks.beforeRegister + let userRecord = data + if (beforeRegister) { + userRecord = await beforeRegister({ + userRecord, + clientInfo: this.getUniversalClientInfo() + }) + } + + await userCollection.add(userRecord) return { errCode: 0, errMsg: '' diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/facial-recognition-verify/get-auth-result.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/facial-recognition-verify/get-auth-result.js index f705533..7993457 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/facial-recognition-verify/get-auth-result.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/facial-recognition-verify/get-auth-result.js @@ -70,6 +70,7 @@ module.exports = async function (params) { status: REAL_NAME_STATUS.CERTIFY_FAILED }) + console.log(ERROR.FRV_FAIL, 'error: ', res) throw { errCode: ERROR.FRV_FAIL } diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-qq.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-qq.js index c4aec72..08794c0 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-qq.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-qq.js @@ -5,10 +5,6 @@ const { const { LOG_TYPE, dbCmd } = require('../../common/constants') -const { - getQQPlatform -} = require('../../lib/utils/qq') - /** * 解绑QQ * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-qq @@ -16,20 +12,11 @@ const { */ module.exports = async function () { const { uid } = this.authInfo - const { appId } = this.getUniversalClientInfo() - const qqPlatform = getQQPlatform.call(this) await preUnBind.call(this, { uid, unBindAccount: { - qq_openid: dbCmd.or([ - { - [qqPlatform]: dbCmd.exists(true) - }, - { - [`${qqPlatform}_${appId}`]: dbCmd.exists(true) - } - ]), + qq_openid: dbCmd.exists(true), qq_unionid: dbCmd.exists(true) }, logType: LOG_TYPE.UNBIND_QQ diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-weixin.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-weixin.js index 9174bef..647cc77 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-weixin.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-weixin.js @@ -16,14 +16,12 @@ const { */ module.exports = async function () { const { uid } = this.authInfo - const weixinPlatform = getWeixinPlatform.call(this) + // const weixinPlatform = getWeixinPlatform.call(this) await preUnBind.call(this, { uid, unBindAccount: { - wx_openid: { - [weixinPlatform]: dbCmd.exists(true) - }, + wx_openid: dbCmd.exists(true), wx_unionid: dbCmd.exists(true) }, logType: LOG_TYPE.UNBIND_WEIXIN diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/create-captcha.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/create-captcha.js index a8f338a..1b79dd8 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/create-captcha.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/create-captcha.js @@ -18,7 +18,7 @@ module.exports = async function (params = {}) { } this.middleware.validate(params, schema) - const deviceId = this.getUniversalClientInfo().deviceId + const { deviceId, platform } = this.getUniversalClientInfo() const { scene } = params @@ -29,6 +29,7 @@ module.exports = async function (params = {}) { } return this.uniCaptcha.create({ deviceId, - scene + scene, + uniPlatform: platform }) } diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/refresh-captcha.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/refresh-captcha.js index 0d7df4b..6c01825 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/refresh-captcha.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/refresh-captcha.js @@ -18,7 +18,8 @@ module.exports = async function (params = {}) { } this.middleware.validate(params, schema) - const deviceId = this.getUniversalClientInfo().deviceId + const { deviceId, platform } = this.getUniversalClientInfo() + const { scene } = params @@ -29,6 +30,7 @@ module.exports = async function (params = {}) { } return this.uniCaptcha.refresh({ deviceId, - scene + scene, + uniPlatform: platform }) } -- GitLab