From 14319e7fd96547a5e75817e0087d1dd856583646 Mon Sep 17 00:00:00 2001 From: Lutkin Wang Date: Fri, 1 Jul 2022 11:54:33 +0800 Subject: [PATCH 1/2] Fix webpack build problem and docs With this change, this project can at least build. But a problem remains. I used the room id and user id that generate the temp token: ```js function checkRoomIdAndUserId(name) { $(`#${name}`).keyup(() => { let ret = checkReg(name) console.log(ret) }); } ``` ret is false. But the login window pops out again and again --- Web/BasicDemo/README.md | 24 ++++++++++++------------ Web/BasicDemo/webpack.config.js | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Web/BasicDemo/README.md b/Web/BasicDemo/README.md index b3c3fe99..74bbadb6 100644 --- a/Web/BasicDemo/README.md +++ b/Web/BasicDemo/README.md @@ -4,26 +4,26 @@ ## 配置 Demo 工程文件 -1. 全局安装 node、yarn -2. 进入工程目录,修改 AppID。使用控制台获取的 AppID 覆盖 src 文件夹下 index.js 里的 appId 值 -3. 进入工程目录,修改 Token。临时 Token 覆盖 src 文件下 index.js 里的 token 值 +1. 全局安装 node、yarn。 +2. 进入工程目录,修改 AppID。使用控制台获取的 AppID 覆盖 js 文件夹下 common.js 里的 appId 值。 +3. 进入工程目录,修改 Token。临时 Token 覆盖 src 文件下 common.js 里的 token 值。 ## 运行 demo 1. 安装 yarn -``` - npm install -g yarn -``` + ```shell + npm install -g yarn + ``` 2. 安装依赖 -``` -yarn -``` + ```shell + yarn + ``` 3. 启动项目 -``` -yarn start -``` + ```shell + yarn start + ``` diff --git a/Web/BasicDemo/webpack.config.js b/Web/BasicDemo/webpack.config.js index d2fbfe8c..098233bb 100644 --- a/Web/BasicDemo/webpack.config.js +++ b/Web/BasicDemo/webpack.config.js @@ -1,7 +1,7 @@ const path = require('path'); module.exports = { - entry: './index.js', + entry: './js/index.js', mode: 'development', output: { filename: 'bundle.js', From 22cef29db3378148278bcdba5a39bab7010bfaae Mon Sep 17 00:00:00 2001 From: Lutkin Wang Date: Fri, 1 Jul 2022 13:41:22 +0800 Subject: [PATCH 2/2] Fix bug --- Web/BasicDemo/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/BasicDemo/js/index.js b/Web/BasicDemo/js/index.js index 925b7def..c25c230c 100644 --- a/Web/BasicDemo/js/index.js +++ b/Web/BasicDemo/js/index.js @@ -54,7 +54,7 @@ $('#submit').on('click', async () => { /* * before join a room, you should create a room,then you can join it with `engine.join(token,roomId,uid, onSuccessFunc, onFailFunc)` */ - await rtc.join((config.token || {})[config.uid], config.roomId, config.uid); + await rtc.join((config.token || {}), config.roomId, config.uid); $('#header-version').text(`${config.roomId}`); $('#local-player').show(); $('#local-player-name').text(`${config.uid}`);