diff --git a/pages.json b/pages.json index 6563c187b1b9dd74c8aa786abf6d8bfdbd58e032..089aaf9e0cf220f0b7952cf8524c81341e38dd6e 100644 --- a/pages.json +++ b/pages.json @@ -123,6 +123,7 @@ "uniIdRouter": { "loginPage": "uni_modules/uni-id-pages/pages/login/login-withoutpwd", "needLogin": [ + "pages/index/index", "uni_modules/uni-id-pages/pages/userinfo/userinfo" ], "resToLogin": true diff --git a/uni_modules/uni-id-pages/changelog.md b/uni_modules/uni-id-pages/changelog.md index 9b1fe26c18c4c923662c8074eb746f76b75e8ebe..bb8c7db75860fb6f1d2eb1cc31b71d765946a986 100644 --- a/uni_modules/uni-id-pages/changelog.md +++ b/uni_modules/uni-id-pages/changelog.md @@ -1,3 +1,7 @@ +## 1.1.2(2023-02-10) +- 新增 微信小程序端 首页需强制登录时,隐藏返回首页按钮 +- uni-id-co 新增 外部联登后修改用户信息接口(updateUserInfoByExternal) [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-update-userinfo) +- uni-id-co 优化外部联登接口(登录、注册)逻辑 ## 1.1.1(2023-02-02) - 新增 微信小程序端 支持选择使用微信资料的“头像”和“昵称” 设置用户资料 [详情参考](https://wdoc-76491.picgzc.qpic.cn/MTY4ODg1MDUyNzQyMDUxNw_21263_rTNhg68FTngQGdvQ_1647431233?w=1280&h=695.7176470588236) ## 1.1.0(2023-01-31) diff --git a/uni_modules/uni-id-pages/common/login-page.mixin.js b/uni_modules/uni-id-pages/common/login-page.mixin.js index 26936dba049ffa8db2c1fd05e28aa637d9f8323a..cff4071e5071f8016e66d91cb2799b16dd888632 100644 --- a/uni_modules/uni-id-pages/common/login-page.mixin.js +++ b/uni_modules/uni-id-pages/common/login-page.mixin.js @@ -45,7 +45,12 @@ let mixin = { if (e.uniIdRedirectUrl) { this.uniIdRedirectUrl = decodeURIComponent(e.uniIdRedirectUrl) - } + } + + if(getCurrentPages().length === 1){ + uni.hideHomeButton() + console.log('已隐藏:返回首页按钮'); + } }, computed: { needAgreements() { diff --git a/uni_modules/uni-id-pages/package.json b/uni_modules/uni-id-pages/package.json index fef819945862cd2be35d666188c9e233a6ca2520..ff2026497545b6c6992b0c3a80f8fa37a42c7c49 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.1", + "version": "1.1.2", "description": "云端一体简单、统一、可扩展的用户中心页面模版", "keywords": [ "用户管理", diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/constants.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/constants.js index a23dee489e413771ee85b769402714870f445497..f7ec54958eb8e71dbe14c969d9e7576d48dd6025 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/constants.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/constants.js @@ -10,6 +10,7 @@ const openDataCollectionName = 'opendb-open-data' const openDataCollection = db.collection(openDataCollectionName) const USER_IDENTIFIER = { + _id: 'uid', username: 'username', mobile: 'mobile', email: 'email', @@ -22,7 +23,8 @@ const USER_IDENTIFIER = { 'qq_openid.app': 'qq-account', 'qq_openid.mp': 'qq-account', ali_openid: 'alipay-account', - apple_openid: 'alipay-account' + apple_openid: 'alipay-account', + identities: 'idp' } const USER_STATUS = { @@ -76,6 +78,8 @@ const EMAIL_SCENE = { BIND_EMAIL: 'bind-email' } +const EXTERNAL_DIRECT_CONNECT_PROVIDER = 'externalDirectConnect' + module.exports = { db, dbCmd, @@ -88,5 +92,6 @@ module.exports = { CAPTCHA_SCENE, LOG_TYPE, SMS_SCENE, - EMAIL_SCENE + EMAIL_SCENE, + EXTERNAL_DIRECT_CONNECT_PROVIDER } diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js index 69013a48e63a49b19262391172bbd9c31d8a1b43..8b152233df1ff33d70f0d6fead1a473efcc694d3 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js @@ -83,7 +83,8 @@ const { const { externalRegister, - externalLogin + externalLogin, + updateUserInfoByExternal } = require('./module/external') module.exports = { @@ -602,15 +603,35 @@ module.exports = { */ setPwd, /** - * 外部用户注册,将自身系统的用户账号导入uniId,为其创建一个对应uniId的账号(unieid),使得该账号可以使用依赖uniId的系统及功能。 + * 外部注册用户 * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-register - * @returns + * @param {object} params + * @param {string} params.externalUid 业务系统的用户id + * @param {string} params.nickname 昵称 + * @param {string} params.gender 性别 + * @param {string} params.avatar 头像 + * @returns {object} */ externalRegister, /** - * 外部用户登录,使用unieid即可登录 + * 外部用户登录 * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-login - * @returns - * */ - externalLogin + * @param {object} params + * @param {string} params.userId uni-id体系用户id + * @param {string} params.externalUid 业务系统的用户id + * @returns {object} + */ + externalLogin, + /** + * 使用 userId 或 externalUid 获取用户信息 + * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-update-userinfo + * @param {object} params + * @param {string} params.userId uni-id体系的用户id + * @param {string} params.externalUid 业务系统的用户id + * @param {string} params.nickname 昵称 + * @param {string} params.gender 性别 + * @param {string} params.avatar 头像 + * @returns {object} + */ + updateUserInfoByExternal } 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 e4b8b33c409dfc903eda828759838a55245c8d2c..e7fe854abb4553ad004142054253f36b87cf3d53 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.38", + "version": "1.1.2", "description": "", "main": "index.js", "keywords": [], diff --git a/uni_modules/uni-id-pages/uniCloud/database/uni-id-users.schema.json b/uni_modules/uni-id-pages/uniCloud/database/uni-id-users.schema.json index f2d13c548e59519b69fa4a43c0d8dc9c9f444697..b5aea024617cdcc5117b45171ff7f7c75324b4a6 100644 --- a/uni_modules/uni-id-pages/uniCloud/database/uni-id-users.schema.json +++ b/uni_modules/uni-id-pages/uniCloud/database/uni-id-users.schema.json @@ -388,7 +388,7 @@ "title": "用户名", "trim": "both", "permission": { - "read": true, + "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" } },