Explorar el Código

修改应用方式

tremble hace 3 años
padre
commit
61011b611a

+ 6 - 4
src/components/RTC/PageRtcLive.vue

@@ -124,7 +124,9 @@ store.commit("rtc/setSocket", createSocket());
 let getUrl = (href, queryArr) => {
   queryArr.forEach((item) => {
     if (!browser.hasURLParam(item.key)) {
-      href += `&${item.key}=${item.val}`;
+      let ttt = href.split('index.html?')
+      href = `${ttt[0]}index.html?${item.key}=${item.val}&${ttt[1]}`;
+      console.log(href);
     } else {
       href = browser.replaceQueryString(href, item.key, item.val);
     }
@@ -418,8 +420,8 @@ const onGetOuT = (data) => {
 const startFollow = (app) => {
   app.Connect.follow.start({ follow: role.value == "customer" });
 
-  store.commit("rtc/setUserId", browser.getURLParam("vruserId") || `user_${role.value}_${Math.floor(Math.random() * 100000000)}`);
-  store.commit("rtc/setRoomId", browser.getURLParam("roomId") || Math.floor(Math.random() * 100000000));
+  store.commit("rtc/setUserId", browser.getURLParam("vruserId") || `user_${role.value}${Math.floor(Math.random() * 100000000)}`);
+  store.commit("rtc/setRoomId", browser.getURLParam("roomId") || String(Math.floor(Math.random() * 100000000)));
 
   socket.value.on("connect", () => {
     socket.value.emit("join", {
@@ -461,7 +463,7 @@ const startFollow = (app) => {
         val: "",
       },
       {
-        key: "userId",
+        key: "vruserId",
         val: "",
       },
       {

+ 1 - 0
src/components/RTC/Trtccom.vue

@@ -147,6 +147,7 @@ async function handleJoin() {
       sdkAppId: parseInt(store.getters["rtc/sdkAppId"], 10),
       userId: store.getters["rtc/userId"],
       userSig: userSig.value,
+      useStringRoomId:true
     });
     installEventHandlers();
 

+ 2 - 1
src/components/RTC/dialog/createdRoom.vue

@@ -60,7 +60,8 @@ export default {
 
       queryArr.forEach(item=>{
         if (!browser.hasURLParam(item.key)) {
-          href += `&${item.key}=${item.val}`;
+          let ttt = href.split('index.html?')
+          href = `${ttt[0]}index.html?${item.key}=${item.val}&${ttt[1]}`;
         } else {
           href = browser.replaceQueryString(href, item.key, item.val);
         }