房间id生成修改

This commit is contained in:
2026-05-17 20:59:34 +08:00
parent 457e59a4d0
commit 7ff53c2cfd
3 changed files with 18 additions and 6 deletions

View File

@@ -3,7 +3,7 @@
* 处理初始连接、创建通话和加入通话的功能
*/
import { showNotification } from '../utils.js';
import { showNotification, randomMeetingId } from '../utils.js';
const MAX_AVATAR_SIZE = 2 * 1024 * 1024; // 2MB
@@ -28,8 +28,10 @@ function createCall() {
showNotification('正在创建通话...');
// 生成随机连接ID
const connectionId = 'conn_' + Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
//const connectionId = 'conn_' + Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
const connectionId = randomMeetingId();
showNotification(`已创建通话 (${connectionId})`);
// 保存连接ID到本地存储
localStorage.setItem('connectionId', connectionId);