|
@@ -33,6 +33,7 @@ export class RoomController extends BasicController {
|
|
|
assistantId: null,
|
|
|
onlineStatus: 0,
|
|
|
voiceStatus: 0,
|
|
|
+ isAssistant: 0,
|
|
|
enableTalk: null,
|
|
|
oid: null, // openid
|
|
|
};
|
|
@@ -74,34 +75,30 @@ export class RoomController extends BasicController {
|
|
|
const oneSceneNum = this.user.sceneNumber || this.user.sceneNum;
|
|
|
const { userId, roomId } = this.user;
|
|
|
await this.initParams(userId, roomId, oneSceneNum);
|
|
|
- let order;
|
|
|
- switch (this.user.role) {
|
|
|
- case "leader":
|
|
|
- order = 0;
|
|
|
- break;
|
|
|
- case "assistant":
|
|
|
- order = 1;
|
|
|
- break;
|
|
|
- case "customer":
|
|
|
- order = 2;
|
|
|
- break;
|
|
|
- default:
|
|
|
- order = 2;
|
|
|
- break;
|
|
|
+
|
|
|
+ //role的顺序
|
|
|
+ let order = 2;
|
|
|
+ if (this.user.role === "leader") {
|
|
|
+ order = 0;
|
|
|
+ }
|
|
|
+ if (this.user.role === "customer" && Number(this.issAssistant) === 1) {
|
|
|
+ order = 1;
|
|
|
}
|
|
|
|
|
|
const userObj = { ...this.user, onlineStatus: 1, isConnected: true, order };
|
|
|
- const assistantId = await this.roomAssistant.getRoomAssistant(this.roomId);
|
|
|
- if (!this.isHoster(this.user.role)) {
|
|
|
- console.log("assistantId", assistantId);
|
|
|
- console.log("this.userId", this.user.userId);
|
|
|
- this.logger.info("默认变更条件:" + (assistantId && Number(this.user.userId) !== Number(assistantId)));
|
|
|
|
|
|
- if (assistantId && Number(this.user.userId) !== Number(assistantId)) {
|
|
|
- this.logger.info("已存在默认助手变更:" + "room助手ID: " + assistantId + " userId: " + this.user.userId);
|
|
|
- userObj.role = "customer";
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ // const assistantId = await this.roomAssistant.getRoomAssistant(this.roomId);
|
|
|
+ // if (!this.isHoster(this.user.role)) {
|
|
|
+ // console.log("assistantId", assistantId);
|
|
|
+ // console.log("this.userId", this.user.userId);
|
|
|
+ // this.logger.info("默认变更条件:" + (assistantId && Number(this.user.userId) !== Number(assistantId)));
|
|
|
+
|
|
|
+ // if (assistantId && Number(this.user.userId) !== Number(assistantId)) {
|
|
|
+ // this.logger.info("已存在默认助手变更:" + "room助手ID: " + assistantId + " userId: " + this.user.userId);
|
|
|
+ // userObj.role = "customer";
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
// if (assistantId && Number(this.userId) !== Number(assistantId) && !this.isHoster(this.user.role)) {
|
|
|
// userObj.role = "customer";
|