Skip to content

Commit 7bfc592

Browse files
committed
bug修复
1 parent becbe6d commit 7bfc592

File tree

4 files changed

+74
-43
lines changed

4 files changed

+74
-43
lines changed

.idea/workspace.xml

Lines changed: 63 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@
101101
<configuration>
102102
<mainClass>com.danbai.ys.YsApplication</mainClass>
103103
<layout>ZIP</layout>
104+
<includes>
105+
<include>
106+
<groupId>nothing</groupId>
107+
<artifactId>nothing</artifactId>
108+
</include>
109+
</includes>
104110
</configuration>
105111
<executions>
106112
<execution>

src/main/java/com/danbai/ys/websocket/CinemaSocketManagement.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public static void joinRoom(String socketId, int roomId, String pass) {
5151
String result = token.buildTokenWithUid(RtcTokenBuilderSample.appId, RtcTokenBuilderSample.appCertificate,
5252
Md5.getMD5LowerCase(cinemaRoom.getName()+cinemaRoom.getId()), Integer.parseInt(socketId,16), RtcTokenBuilder.Role.Role_Publisher, timestamp);
5353
jsonObject.put("token",result);
54-
jsonObject.put("id",roomId);
54+
jsonObject.put("channel",Md5.getMD5LowerCase(cinemaRoom.getName()+cinemaRoom.getId()));
55+
jsonObject.put("id",String.valueOf(cinemaRoom.getId()));
5556
jsonObject.put("name",cinemaRoom.getName());
5657
jsonObject.put("uid",Integer.parseInt(socketId,16));
5758
}

src/main/resources/templates/yiqikan/index.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ <h3 id="fangjianInfo"></h3>
129129
<script src="https://cdn.jsdelivr.net/npm/p2p-dplayer@latest"></script>
130130
<script src="https://cdn.p00q.cn/ys/js/AgoraRTCSDK-3.0.1.js"></script>
131131
<script src="https://cdn.p00q.cn/ys/js/materialize.min.js"></script>
132-
<script src="https://cdn.bootcss.com/blueimp-md5/2.12.0/js/md5.min.js"></script>
133132
<script th:inline="javascript">
134133
/*<![CDATA[*/
135134
var username = /*[[${session.user.username}]]*/ null;
@@ -337,7 +336,7 @@ <h3 id="fangjianInfo"></h3>
337336
$("#fangjian").show();
338337
ws.send(toJsonStr({ type: "roomInfo" }));
339338
options.uid=data.uid;
340-
options.channel=md5(data.name+data.id);
339+
options.channel=data.channel;
341340
options.token=data.token;
342341
} else {
343342
Notiflix.Notify.Failure('加入失败');
@@ -710,10 +709,10 @@ <h3 id="fangjianInfo"></h3>
710709
console.log("client leaves channel success");
711710
rtc.published = false;
712711
rtc.joined = false;
713-
Toast.notice("leave success");
712+
714713
}, function (err) {
715714
console.log("channel leave failed");
716-
Toast.error("leave success");
715+
717716
console.error(err);
718717
})
719718
}

0 commit comments

Comments
 (0)