提交 63f53d3d 编写于 作者: 雪洛's avatar 雪洛

feat: logout时删除token

上级 2e42f519
const {
dbCmd,
LOG_TYPE,
deviceCollection
deviceCollection,
userCollection
} = require('../../common/constants')
/**
* 用户退出登录
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#logout
......@@ -20,6 +23,12 @@ module.exports = async function () {
autoRefresh: false
}
)
// 删除token
await userCollection.doc(uid).update({
token: dbCmd.pull(uniIdToken)
})
// 仅当device表的device_id和user_id均对应时才进行更新
await deviceCollection.where({
device_id: deviceId,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册