用户详情页面

This commit is contained in:
masnn committed 2020-04-10 23:17:52 +08:00
1 parent 26c467f60f
commit 0e590ebe0d
4 files changed
+64 -214

No files matched your search

+3 -1
View File
@@ -65,7 +65,9 @@ module.exports = {
let result = await coll.deleteOne({ _id: tokenId, tokenType });
return !!result.deletedCount;
},
async getMostRecentSessionByUid(uid) {
return await coll.findOne({ data: { uid }, token_type: this.TYPE_SESSION }, { sort: { updateAt: -1 } });
},
init: () => Promise.all([
coll.createIndex([{ uid: 1 }, { tokenType: 1 }, { updateAt: -1 }], { sparse: true }),
coll.createIndex('expireAt', { expireAfterSeconds: 0 })