|
@@ -24,8 +24,8 @@ export class ConnectController extends BasicController {
|
|
|
const from = this.roomController.user.from;
|
|
|
const roomId = this.roomController.roomId;
|
|
|
const role = this.roomController.user.role;
|
|
|
- //const user = this.roomController.user;
|
|
|
- const user = await this.roomController.currentUser();
|
|
|
+ const user = this.roomController.user;
|
|
|
+
|
|
|
this.roomController.logger.info("断开连接", {
|
|
|
userId,
|
|
|
from,
|
|
@@ -39,9 +39,10 @@ export class ConnectController extends BasicController {
|
|
|
// const res = await this.roomController.roomAssistant.checkRoomMaximum(roomId);
|
|
|
const isInRoom = await isUserInRoom(roomId, user.userId);
|
|
|
if (!this.roomController.roomAssistant.roomMax && isInRoom) {
|
|
|
- console.log("已在线,被断开后", user);
|
|
|
- user.onlineStatus = 0;
|
|
|
- await updateRoomUser(roomId, userId, user);
|
|
|
+ console.log("已在线,被断开后", isInRoom);
|
|
|
+ isInRoom.onlineStatus = 0;
|
|
|
+ this.roomController.user = isInRoom;
|
|
|
+ await updateRoomUser(roomId, userId, isInRoom);
|
|
|
await this.roomController.roomAssistant.notifyUsersChange(roomId, user, false);
|
|
|
}
|
|
|
}
|