|
@@ -1,5 +1,5 @@
|
|
|
import { ROLES, CODEMEG, EVENT, FROMTYPE } from "../../enum/index.js";
|
|
|
-import { getCurrentUser, updateUser, removeRoomAllUsers, getAllRoomUsers, updateRoomUser } from "../../service/userService.js";
|
|
|
+import { getCurrentUser, updateUser, removeRoomAllUsers, getAllRoomUsers, updateRoomUser, removeRoomUser } from "../../service/userService.js";
|
|
|
// import { watchRoomService } from "../../service/watchRoomService.js";
|
|
|
import { setRoomConfig, getRoomConfig, updateRoomConfigByKey, isRoomMaster } from "../../service/roomConfigService.js";
|
|
|
|
|
@@ -34,6 +34,7 @@ export class RoomController extends BasicController {
|
|
|
onlineStatus: 0,
|
|
|
voiceStatus: 0,
|
|
|
enableTalk: null,
|
|
|
+ oid: null, // openid
|
|
|
};
|
|
|
}
|
|
|
// 以小程序user信息作为主要信息
|
|
@@ -101,7 +102,13 @@ export class RoomController extends BasicController {
|
|
|
userObj.role = "customer";
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if (user.oid) {
|
|
|
+ const hasDuplicateUser = this.roomAssistant.getOpenidInRoom(this.roomId, user.oid);
|
|
|
+ if (hasDuplicateUser) {
|
|
|
+ this.logger.info("hasDuplicateUser", hasDuplicateUser);
|
|
|
+ await removeRoomUser(this.roomId, hasDuplicateUser.userId);
|
|
|
+ }
|
|
|
+ }
|
|
|
// if (assistantId && Number(this.userId) !== Number(assistantId) && !this.isHoster(this.user.role)) {
|
|
|
// userObj.role = "customer";
|
|
|
// }
|