链接视频跳转

This commit is contained in:
gyj
2024-04-15 17:51:49 +08:00
parent a2b625937e
commit f3070e1127
2 changed files with 43 additions and 18 deletions
+6 -2
View File
@@ -1,7 +1,7 @@
import axios from "@/utils/request";
let baseUrlZc = 'https://api.xayunmei.com/zhongcaiapi';
let baseUrl = 'https://api.xayunmei.com/tiaojieapitest';
// let baseUrl = 'http://121.40.189.20:6001';
let baseUrl = 'https://api.xayunmei.com/tiaojieapi';
// let baseUrl = 'http://172.16.1.4:6001';
// 获取usersig
export function getUsersig(userId) {
let appType = sessionStorage.getItem('type');
@@ -29,4 +29,8 @@ export function reserveConferenceList(caseId) {
return axios.get(`${baseUrlZc}/caseApplication/reserveConferenceList?caseId=${caseId}`);
}
}
//根据id查询密文信息
export function getEncryptInfoByid(caseId) {
return axios.get(`${baseUrl}/shortMessage/getMeetingInfo?authId=${caseId}`);
}
+37 -16
View File
@@ -8,7 +8,12 @@
<el-form-item>
<el-input placeholder="请输入房间号" v-model="enterRoomFrom.roomId">
<template slot="append">
<el-button type="primary" @click="enterRoom" icon="el-icon-right">进入</el-button>
<el-button
type="primary"
@click="enterRoom"
icon="el-icon-right"
>进入</el-button
>
</template>
</el-input>
</el-form-item>
@@ -19,7 +24,7 @@
</template>
<script>
import { reserveConferenceList } from "@/api/home.js";
import { reserveConferenceList, getEncryptInfoByid } from "@/api/home.js";
import TRTC from "trtc-sdk-v5";
let trtc = null;
export default {
@@ -33,10 +38,17 @@ export default {
userCode: null,
caseId: null,
roleFlag: false,
token:""
token: "",
queryObj: {},
};
},
methods: {
/**获取链接参数 */
async getEncryptInfoByidFn(data) {
await getEncryptInfoByid(data).then((res) => {
this.queryObj = res;
});
},
async enterRoom() {
// if (this.roomId != this.enterRoomFrom.roomId) {
// this.$message({
@@ -53,35 +65,44 @@ export default {
flag: this.roleFlag,
caseId: this.caseId,
id: this.userCode,
token: this.token
}
token: this.token,
},
});
},
submitRoom() {
this.$refs["formLabelAlign"].validate(valid => {});
this.$refs["formLabelAlign"].validate((valid) => {});
},
// 根据案件id查询主持人信息
async reserveConferenceListFn(data) {
await reserveConferenceList(data).then(res => {
await reserveConferenceList(data).then((res) => {
if (res.data.length >= 1) {
if (this.userCode == res.data[0].userId) {
this.roleFlag = true;
} else {
this.roleFlag = false;
}
}else{
} else {
this.roleFlag = false;
}
});
}
},
},
async mounted() {
let routeParams = this.$route.query;
this.userId = routeParams.name;
this.roomId = routeParams.roomId;
this.userCode = routeParams.userId;
this.caseId = routeParams.id;
this.token = routeParams.token;
await this.getEncryptInfoByidFn(routeParams.authId);
if (routeParams.authId) {
this.userId = this.queryObj.userName;
this.roomId = this.queryObj.roomId;
this.userCode = this.queryObj.userId;
this.caseId = this.queryObj.caseId;
this.token = this.queryObj.token;
} else {
this.userId = routeParams.name;
this.roomId = routeParams.roomId;
this.userCode = routeParams.userId;
this.caseId = routeParams.id;
this.token = routeParams.token;
}
if (this.caseId) {
await this.reserveConferenceListFn(this.caseId);
await this.enterRoom();
@@ -89,10 +110,10 @@ export default {
trtc = TRTC.create();
const config = {
view: document.getElementById("video"),
publish: false
publish: false,
};
await trtc.startLocalVideo(config);
}
},
};
</script>