|
@@ -1,20 +1,22 @@
|
|
|
import consolaGlobalInstance from 'consola';
|
|
|
// import sortBy from 'lodash-es/sortBy';
|
|
|
-import { unref } from 'vue';
|
|
|
+import { unref, ref } from 'vue';
|
|
|
import { useI18n } from '/@/hooks/useI18n';
|
|
|
// import { unref } from 'vue';
|
|
|
// import Dialog from '/@/components/basic/dialog';
|
|
|
// import { getApp } from '/@/hooks/userApp';
|
|
|
-import { useRoom } from '/@/hooks/useRoom';
|
|
|
+import { roomId, useRoom } from '/@/hooks/useRoom';
|
|
|
import { useSocket } from '/@/hooks/userSocket';
|
|
|
import { UserInfoType, useRtcStore } from '/@/store/modules/rtc';
|
|
|
import { useAppStore } from '/@/store/modules/app';
|
|
|
// import { useRtcSdk } from '/@/hooks/useTRTC';
|
|
|
// import { useMiniApp } from '/@/hooks/useMiniApp';
|
|
|
const { enterRoom } = useRoom();
|
|
|
+const isInternational = ref(import.meta.env.VITE_IS_INTERNATIONAL);
|
|
|
+const is404Page = ref(import.meta.env.VITE_404_PAGE);
|
|
|
|
|
|
// 自已join的方法
|
|
|
-export function handleJoin(data: any) {
|
|
|
+export async function handleJoin(data: any) {
|
|
|
// const app = getApp();
|
|
|
const { socket, closeSocket } = useSocket();
|
|
|
const members = data?.members as any as UserInfoType[];
|
|
@@ -23,7 +25,14 @@ export function handleJoin(data: any) {
|
|
|
|
|
|
// const userExsit = rtcStore.checkUserInMemberList(rtcStore.userId);
|
|
|
// banLaterEnterer(members, user);
|
|
|
- enterRoom();
|
|
|
+ const res = await enterRoom();
|
|
|
+ const { code } = res.data;
|
|
|
+
|
|
|
+ if (code === 4003 && !roomId.includes('temp_') && unref(isInternational)) {
|
|
|
+ location.href = is404Page.value;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
rtcStore.setIsJoined(true);
|
|
|
consolaGlobalInstance.info({
|
|
|
message: data,
|