防沉迷:修复登录退出时不必全部用户循环

This commit is contained in:
luying
2021-03-10 10:35:58 +08:00
parent 1764ce6462
commit 83d9e398db
3 changed files with 44 additions and 34 deletions
+3 -1
View File
@@ -377,7 +377,9 @@ export async function roleLogin(roleId: string, userCode: string, sid: string, p
* @param roleId role表id
*/
export async function roleLeave(roleId: string) {
return await redisClient().hdelAsync(REDIS_KEY.ONLINE_USERS, roleId);
let role = await getRoleOnlineInfo(roleId);
await redisClient().hdelAsync(REDIS_KEY.ONLINE_USERS, roleId);
return role;
}
/**