|
@@ -1,5 +1,5 @@
|
|
|
import consolaGlobalInstance from 'consola';
|
|
|
-// import Dialog from '/@/components/basic/dialog';
|
|
|
+import Dialog from '/@/components/basic/dialog';
|
|
|
// import { getApp } from '/@/hooks/userApp';
|
|
|
import { useRoom } from '/@/hooks/useRoom';
|
|
|
import { useSocket } from '/@/hooks/userSocket';
|
|
@@ -11,7 +11,7 @@ export function handleJoin(data: any) {
|
|
|
// const app = getApp();
|
|
|
const { socket } = useSocket();
|
|
|
const members = data?.members as any as UserInfoType[];
|
|
|
- // const user = data?.user as any as UserInfoType;
|
|
|
+ const user = data?.user as any as UserInfoType;
|
|
|
enterRoom();
|
|
|
|
|
|
const rtcStore = useRtcStore();
|
|
@@ -20,24 +20,24 @@ export function handleJoin(data: any) {
|
|
|
message: data,
|
|
|
tag: 'socket:enter',
|
|
|
});
|
|
|
- // if (user) {
|
|
|
- // console.log('sortList 1 ', rtcStore.userId)
|
|
|
- // console.log('sortList 2', rtcStore.memberList)
|
|
|
- // const userExsit = rtcStore.checkUserInMemberList(rtcStore.userId)
|
|
|
- // console.log('sortList3 ', userExsit)
|
|
|
- // console.log('sortList4', user.Id !== userExsit?.Id)
|
|
|
- // if (userExsit) {
|
|
|
- // Dialog.confirm({
|
|
|
- // showCloseIcon: false,
|
|
|
- // okText: '我知道了',
|
|
|
- // content: "<span style='font-size: 16px; line-height: 1.5;'>您已有登录端在登录,请不要重复登录<span/>",
|
|
|
- // title: '隱私條款:',
|
|
|
- // single: true,
|
|
|
- // func: (state) => {
|
|
|
- // },
|
|
|
- // });
|
|
|
- // }
|
|
|
- // }
|
|
|
+ if (user) {
|
|
|
+ console.log('gem1', rtcStore.userId);
|
|
|
+ console.log('gem2', rtcStore.memberList);
|
|
|
+ const userExsit = rtcStore.checkUserInMemberList(rtcStore.userId);
|
|
|
+ console.log('gem3', userExsit, user.Id !== userExsit?.Id);
|
|
|
+ if (userExsit) {
|
|
|
+ // Dialog.confirm({
|
|
|
+ // showCloseIcon: false,
|
|
|
+ // okText: '我知道了',
|
|
|
+ // content:
|
|
|
+ // "<span style='font-size: 16px; line-height: 1.5;'>您已有登录端在登录,请不要重复登录<span/>",
|
|
|
+ // title: '隱私條款:',
|
|
|
+ // single: true,
|
|
|
+ // func: (state) => {},
|
|
|
+ // });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ }
|
|
|
|
|
|
members && rtcStore.setMemberList(members);
|
|
|
if (!rtcStore.isLeader) {
|