|
@@ -199,7 +199,7 @@
|
|
|
import memberList from './memberList.vue';
|
|
|
import SceneList from './sceneList.vue';
|
|
|
import Camera from './camera.vue';
|
|
|
- import { useRoom, SceneItemType } from '/@/hooks/useRoom';
|
|
|
+ import { useRoom, SceneItemType, webLogin } from '/@/hooks/useRoom';
|
|
|
import consola from 'consola';
|
|
|
import CloseDialog from './dialog/close.vue';
|
|
|
import PasswordDialog from './dialog/password.vue';
|
|
@@ -266,6 +266,8 @@
|
|
|
const { isUsingMiniApp } = useMiniApp();
|
|
|
const { muteVideoLeader } = useRtcSdk();
|
|
|
|
|
|
+ const isH5 = browser.getURLParam('platform') === 'h5' || browser.getURLParam('platform') === 'fd';
|
|
|
+
|
|
|
const currentProfileAvatar = computed(() => {
|
|
|
let url = '';
|
|
|
if (currentLeader.value?.Avatar) {
|
|
@@ -373,8 +375,19 @@
|
|
|
// startJoin();
|
|
|
// }
|
|
|
|
|
|
- const handleNameConfirm = (userName: string) => {
|
|
|
+ const handleNameConfirm = async (userName: string) => {
|
|
|
const rtcStore = useRtcStore();
|
|
|
+
|
|
|
+ if (isH5) {
|
|
|
+ const res = await webLogin(userName);
|
|
|
+ const { sessionKey } = res;
|
|
|
+ console.log('sessionKey', sessionKey);
|
|
|
+ if (sessionKey) {
|
|
|
+ rtcStore.userId = sessionKey;
|
|
|
+ initParams.userId = sessionKey;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // debugger;
|
|
|
console.log('userName', unref(userName));
|
|
|
rtcStore.setNickName(unref(userName));
|
|
|
const search = new URLSearchParams(location.search);
|
|
@@ -382,12 +395,11 @@
|
|
|
// search.set('vruserId', rtcStore.userId);
|
|
|
initParams.nickname = rtcStore.nickname;
|
|
|
console.log('输入后', initParams);
|
|
|
- startJoin(() => {
|
|
|
- search.set('vruserId', rtcStore.userId);
|
|
|
- const replaceUrl = location.origin + location.pathname + '?' + search.toString();
|
|
|
- console.log('replaceUrl', replaceUrl);
|
|
|
- history.replaceState(null, '', replaceUrl);
|
|
|
- });
|
|
|
+ search.set('vruserId', rtcStore.userId);
|
|
|
+ const replaceUrl = location.origin + location.pathname + '?' + search.toString();
|
|
|
+ console.log('replaceUrl', replaceUrl);
|
|
|
+ history.replaceState(null, '', replaceUrl);
|
|
|
+ startJoin();
|
|
|
window.parent &&
|
|
|
window.parent.postMessage(
|
|
|
{
|
|
@@ -618,6 +630,7 @@
|
|
|
if (browser.getURLParam('platform') && browser.getURLParam('platform').length > 0) {
|
|
|
search.set('platform', browser.getURLParam('platform'));
|
|
|
}
|
|
|
+
|
|
|
const lang = unref(getLocale);
|
|
|
search.set('lang', lang);
|
|
|
Number(import.meta.env.VITE_SHOW_CONSOLE) === 1 && search.set('vlog', '1');
|
|
@@ -697,7 +710,6 @@
|
|
|
}
|
|
|
};
|
|
|
const handlePasswordConfirm = async () => {
|
|
|
- debugger;
|
|
|
showPasswordDialog.value = false;
|
|
|
const socket = createSocket();
|
|
|
initSocketEvent(socket);
|
|
@@ -714,7 +726,6 @@
|
|
|
// };
|
|
|
const handleShare = () => {
|
|
|
const { socket } = useSocket();
|
|
|
- debugger;
|
|
|
socket.emit('action', {
|
|
|
type: 'share',
|
|
|
data: {
|