diff --git a/manifest.json b/manifest.json index 62aa7da550846f8c333bb1c44d318d2636476f8a..9938dffb8f88bc34c7d7bfd2c5ecbe29debfa449 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 fcf5c143e5c5f465d58218477eaa562953115384..031c0c29b168939a5395946a3b2bfd1044ca85d5 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 1a5eb0a52c8ffec033530dbe093fe46077af9662..21d6ae708bd29043173dfb956c0220f49ae24fd1 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 6ec84119c7068adf9034a6239616384adf9249bc..772d7c81b835ada3974c6d5158b6ddd0bac4673a 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 70aade3e7b412f6a7f88f1f719cfacf4d8d00699..d13369a06eb261cb9a467cce5b7b0ce475e949de 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 f705533d167cfb37fe93eb3e27ccb8c37435cb63..7993457952dc5471768d333a968b6d9917b11682 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 c4aec7235a311525bef29b7b02490ea02c6221b1..08794c0216600e08608b34e01848b8d01b7c003f 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 9174bef446ef7352556e3d78d07a55ba6316a51e..647cc77dfce3522e285b96c7803ed114925cf3fa 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 a8f338afede3fd1c3f6df203f4d168f3f9b3e5d2..1b79dd8a7d782fcf04337e7ad51c7be6ee2ec03d 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 0d7df4be673541a799394515f6778f9af29eb957..6c0182521e03f6c49fdb2d765766afc1c4c1533c 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 }) }