提交 818b0f7d 编写于 作者: DCloud_JSON's avatar DCloud_JSON

新增监听token更新时机,同步客户端push_clientid至uni-id-device表

上级 17542496
## 1.0.3(2022-07-05)
新增监听token更新时机,同步客户端push_clientid至uni-id-device表
## 1.0.2(2022-07-04) ## 1.0.2(2022-07-04)
修复微信小程序登录时无unionid报错的Bug [详情](https://ask.dcloud.net.cn/question/148016) 修复微信小程序登录时无unionid报错的Bug [详情](https://ask.dcloud.net.cn/question/148016)
## 1.0.1(2022-06-28) ## 1.0.1(2022-06-28)
......
...@@ -72,4 +72,28 @@ export default async function() { ...@@ -72,4 +72,28 @@ export default async function() {
} }
// 解绑clientDB错误事件 // 解绑clientDB错误事件
//db.off('error', onDBError) //db.off('error', onDBError)
//4. 同步客户端push_clientid至device表
if (uniCloud.onRefreshToken) {
uniCloud.onRefreshToken(() => {
console.log('onRefreshToken');
if (uni.canIUse('getPushClientId')) {
uni.getPushClientId({
success: async function(e) {
console.log(e)
let pushClientId = e.cid
console.log(pushClientId);
let res = await uniIdCo.setPushCid({
pushClientId
})
console.log(res);
},
fail(e) {
console.log(e)
}
})
}
})
}
} }
{ {
"id": "uni-id-pages", "id": "uni-id-pages",
"displayName": "uni-id-pages", "displayName": "uni-id-pages",
"version": "1.0.1", "version": "1.0.2",
"description": "云端一体简单、统一、可扩展的用户中心页面模版", "description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [ "keywords": [
"用户管理", "用户管理",
...@@ -89,8 +89,7 @@ ...@@ -89,8 +89,7 @@
"钉钉": "u", "钉钉": "u",
"快手": "u", "快手": "u",
"飞书": "u", "飞书": "u",
"京东": "u", "京东": "u"
"小红书": "u"
}, },
"快应用": { "快应用": {
"华为": "u", "华为": "u",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册