瀏覽代碼

链接视频跳转

gyj 2 年之前
父節點
當前提交
f3070e1127
共有 2 個檔案被更改,包括 43 行新增18 行删除
  1. 6
    2
      src/api/home.js
  2. 37
    16
      src/components/homepc.vue

+ 6
- 2
src/api/home.js 查看文件

@@ -1,7 +1,7 @@
1 1
 import axios from "@/utils/request";
2 2
 let baseUrlZc = 'https://api.xayunmei.com/zhongcaiapi';
3
-let baseUrl = 'https://api.xayunmei.com/tiaojieapitest';
4
-// let baseUrl = 'http://121.40.189.20:6001';
3
+let baseUrl = 'https://api.xayunmei.com/tiaojieapi';
4
+// let baseUrl = 'http://172.16.1.4:6001';
5 5
 // 获取usersig
6 6
 export function getUsersig(userId) {
7 7
     let appType = sessionStorage.getItem('type');
@@ -29,4 +29,8 @@ export function reserveConferenceList(caseId) {
29 29
         return axios.get(`${baseUrlZc}/caseApplication/reserveConferenceList?caseId=${caseId}`);
30 30
     }
31 31
     
32
+}
33
+//根据id查询密文信息
34
+export function getEncryptInfoByid(caseId) {
35
+        return axios.get(`${baseUrl}/shortMessage/getMeetingInfo?authId=${caseId}`);
32 36
 }

+ 37
- 16
src/components/homepc.vue 查看文件

@@ -8,7 +8,12 @@
8 8
           <el-form-item>
9 9
             <el-input placeholder="请输入房间号" v-model="enterRoomFrom.roomId">
10 10
               <template slot="append">
11
-                <el-button type="primary" @click="enterRoom" icon="el-icon-right">进入</el-button>
11
+                <el-button
12
+                  type="primary"
13
+                  @click="enterRoom"
14
+                  icon="el-icon-right"
15
+                  >进入</el-button
16
+                >
12 17
               </template>
13 18
             </el-input>
14 19
           </el-form-item>
@@ -19,7 +24,7 @@
19 24
 </template>
20 25
   
21 26
 <script>
22
-import { reserveConferenceList } from "@/api/home.js";
27
+import { reserveConferenceList, getEncryptInfoByid } from "@/api/home.js";
23 28
 import TRTC from "trtc-sdk-v5";
24 29
 let trtc = null;
25 30
 export default {
@@ -33,10 +38,17 @@ export default {
33 38
       userCode: null,
34 39
       caseId: null,
35 40
       roleFlag: false,
36
-      token:""
41
+      token: "",
42
+      queryObj: {},
37 43
     };
38 44
   },
39 45
   methods: {
46
+    /**获取链接参数 */
47
+    async getEncryptInfoByidFn(data) {
48
+      await getEncryptInfoByid(data).then((res) => {
49
+        this.queryObj = res;
50
+      });
51
+    },
40 52
     async enterRoom() {
41 53
       // if (this.roomId != this.enterRoomFrom.roomId) {
42 54
       //     this.$message({
@@ -53,35 +65,44 @@ export default {
53 65
           flag: this.roleFlag,
54 66
           caseId: this.caseId,
55 67
           id: this.userCode,
56
-          token: this.token
57
-        }
68
+          token: this.token,
69
+        },
58 70
       });
59 71
     },
60 72
     submitRoom() {
61
-      this.$refs["formLabelAlign"].validate(valid => {});
73
+      this.$refs["formLabelAlign"].validate((valid) => {});
62 74
     },
63 75
     // 根据案件id查询主持人信息
64 76
     async reserveConferenceListFn(data) {
65
-      await reserveConferenceList(data).then(res => {
77
+      await reserveConferenceList(data).then((res) => {
66 78
         if (res.data.length >= 1) {
67 79
           if (this.userCode == res.data[0].userId) {
68 80
             this.roleFlag = true;
69 81
           } else {
70 82
             this.roleFlag = false;
71 83
           }
72
-        }else{
84
+        } else {
73 85
           this.roleFlag = false;
74 86
         }
75 87
       });
76
-    }
88
+    },
77 89
   },
78 90
   async mounted() {
79 91
     let routeParams = this.$route.query;
80
-    this.userId = routeParams.name;
81
-    this.roomId = routeParams.roomId;
82
-    this.userCode = routeParams.userId;
83
-    this.caseId = routeParams.id;
84
-    this.token = routeParams.token;
92
+    await this.getEncryptInfoByidFn(routeParams.authId);
93
+    if (routeParams.authId) {
94
+      this.userId = this.queryObj.userName;
95
+      this.roomId = this.queryObj.roomId;
96
+      this.userCode = this.queryObj.userId;
97
+      this.caseId = this.queryObj.caseId;
98
+      this.token = this.queryObj.token;
99
+    } else {
100
+      this.userId = routeParams.name;
101
+      this.roomId = routeParams.roomId;
102
+      this.userCode = routeParams.userId;
103
+      this.caseId = routeParams.id;
104
+      this.token = routeParams.token;
105
+    }
85 106
     if (this.caseId) {
86 107
       await this.reserveConferenceListFn(this.caseId);
87 108
       await this.enterRoom();
@@ -89,10 +110,10 @@ export default {
89 110
     trtc = TRTC.create();
90 111
     const config = {
91 112
       view: document.getElementById("video"),
92
-      publish: false
113
+      publish: false,
93 114
     };
94 115
     await trtc.startLocalVideo(config);
95
-  }
116
+  },
96 117
 };
97 118
 </script>
98 119