Kaynağa Gözat

链接视频跳转

gyj 2 yıl önce
ebeveyn
işleme
f3070e1127
2 değiştirilmiş dosya ile 43 ekleme ve 18 silme
  1. 6
    2
      src/api/home.js
  2. 37
    16
      src/components/homepc.vue

+ 6
- 2
src/api/home.js Dosyayı Görüntüle

1
 import axios from "@/utils/request";
1
 import axios from "@/utils/request";
2
 let baseUrlZc = 'https://api.xayunmei.com/zhongcaiapi';
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
 // 获取usersig
5
 // 获取usersig
6
 export function getUsersig(userId) {
6
 export function getUsersig(userId) {
7
     let appType = sessionStorage.getItem('type');
7
     let appType = sessionStorage.getItem('type');
29
         return axios.get(`${baseUrlZc}/caseApplication/reserveConferenceList?caseId=${caseId}`);
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 Dosyayı Görüntüle

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