From 1514d027f2b27f2f14628ca7fef6c445b2d8231e Mon Sep 17 00:00:00 2001 From: chenruilong Date: Wed, 29 Mar 2023 15:32:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(uni-id-co):=20=E6=9B=B4=E6=96=B0push=5Fclie?= =?UTF-8?q?ntid=E6=97=B6=E5=9B=A0device=5Fid=E6=B2=A1=E6=9C=89=E5=8F=98?= =?UTF-8?q?=E5=8C=96=E5=AF=BC=E8=87=B4=E6=97=A0=E6=B3=95=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- uni_modules/uni-id-pages/changelog.md | 13 +++++---- .../uni-id-co/module/utils/set-push-cid.js | 27 +++++++------------ 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 32ae8fa..9efd319 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ node_modules/ uni_modules_tools/copy /uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json /uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/custom-password.js - +/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-uni-cloud-s2s/config.json .idea .vscode uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/.eslintrc.js diff --git a/uni_modules/uni-id-pages/changelog.md b/uni_modules/uni-id-pages/changelog.md index f80c251..fcf5c14 100644 --- a/uni_modules/uni-id-pages/changelog.md +++ b/uni_modules/uni-id-pages/changelog.md @@ -1,8 +1,11 @@ -## 1.1.11(2023-03-24) -- 修复 tabbar页面因为token无效而强制跳转至登录页面(url参数包含`uniIdRedirectUrl`)后无法返回的问题 -## 1.1.10(2023-03-24) -- 修复 PC微信扫码登录跳转地址错误 -- uni-id-co 新增 请求鉴权支持 uni-cloud-s2s 模块验证签名 [uni-cloud-s2s文档](https://uniapp.dcloud.net.cn/uniCloud/uni-cloud-s2s.html) +## 1.1.12(2023-03-29) +- uni-id-co 修复 更新push_clientid时因device_id没有变化导致无法更新 +- uni-id-co 新增 自无unionid到有unionid状态进行登录时为用户补充unionid字段 +## 1.1.11(2023-03-24) +- 修复 tabbar页面因为token无效而强制跳转至登录页面(url参数包含`uniIdRedirectUrl`)后无法返回的问题 +## 1.1.10(2023-03-24) +- 修复 PC微信扫码登录跳转地址错误 +- uni-id-co 新增 请求鉴权支持 uni-cloud-s2s 模块验证签名 [uni-cloud-s2s文档](https://uniapp.dcloud.net.cn/uniCloud/uni-cloud-s2s.html) ## 1.1.9(2023-03-24) - 修复 跳转至登录页面的url参数包含`uniIdRedirectUrl`后无法返回的问题 ## 1.1.8(2023-03-02) diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/set-push-cid.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/set-push-cid.js index 669a6d5..54f8ed6 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/set-push-cid.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/set-push-cid.js @@ -117,25 +117,16 @@ module.exports = async function (params = {}) { errCode: 0 } } - // 同一用户允许更新token_expired,不同用户在token_expired小于Date.now()时允许更新。搭配逻辑:用户退出登录时将token_expired置0 - if ( - deviceRecord.user_id === uid || - (deviceRecord.token_expired < Date.now()) - ) { - await deviceCollection.where({ - device_id: deviceId - }).update({ - user_id: uid, - token_expired: tokenExpired, - push_clientid: pushClientId, - appid: appId - }) - return { - errCode: 0 - } - } + await deviceCollection.where({ + device_id: deviceId + }).update({ + user_id: uid, + token_expired: tokenExpired, + push_clientid: pushClientId, + appid: appId + }) return { - errCode: ERROR.SYSTEM_ERROR + errCode: 0 } } -- GitLab