12345678910111213141516171819202122232425 |
- import { getApp } from "/@/hooks/userApp";
- import { useRoom } from "/@/hooks/useRoom";
- import { useSocket } from "/@/hooks/userSocket";
- import { useRtcStore } from "/@/store/modules/rtc";
- const { enterRoom } = useRoom()
- // 自已join的方法
- export function handleJoin(data: any) {
- const app = getApp();
- const socket = useSocket()
- enterRoom();
- const rtcStore = useRtcStore();
- rtcStore.setIsJoined(true)
- //
- if (!rtcStore.isLeader) {
- setTimeout(() => {
- socket.emit("action", {
- type: "user-init",
- });
- }, 1500);
- }
- }
|