提交 1514d027 编写于 作者: C chenruilong

fix(uni-id-co): 更新push_clientid时因device_id没有变化导致无法更新

上级 9a049762
......@@ -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
......
## 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)
......
......@@ -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
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册