This commit is contained in:
undefined committed 2020-08-19 21:28:32 +08:00
1 parent ce79bfab8b
commit 6b92b96225
4 files changed
+40 -2

No files matched your search

+3 -2
View File
@@ -78,8 +78,9 @@ export function getSessionListByUid(uid: number) {
return coll.find({ uid, tokenType: TYPE_SESSION }).sort('updateAt', -1).toArray();
}
export function getMostRecentSessionByUid(uid: number) {
return coll.findOne({ uid, tokenType: TYPE_SESSION }, { sort: { updateAt: -1 } });
export async function getMostRecentSessionByUid(uid: number) {
const res = await coll.find({ uid, tokenType: TYPE_SESSION }).sort('updateAt', -1);
return res[0];
}
export function delByUid(uid: number) {