签名获取
This commit is contained in:
@ -7,6 +7,14 @@ export function getMeetingDetailById(id) {
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
// 生成签名
|
||||
export function generateSignature(params) {
|
||||
return request({
|
||||
url: `/app/generateSignature`,
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
}
|
||||
// 添加预约
|
||||
export function newAppointment(data) {
|
||||
return request({
|
||||
|
@ -69,7 +69,7 @@
|
||||
<script setup>
|
||||
import { computed, reactive, watch, ref, onMounted } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { signMeeting } from "@/api/meeting";
|
||||
import { signMeeting, generateSignature } from "@/api/meeting";
|
||||
import wangEditor from "@/components/wangEditor";
|
||||
import questions from "@/components/questions";
|
||||
import messageList from "@/components/messageList";
|
||||
@ -134,7 +134,7 @@ const meetingConfig = reactive({
|
||||
meetingNumber: store.getters.meetingNumber,
|
||||
passWord: store.state.password,
|
||||
role: 0,
|
||||
signatureEndpoint: "http://120.26.107.74:4000",
|
||||
// signatureEndpoint: "http://120.26.107.74:4000",
|
||||
userEmail: "",
|
||||
userName: joinAccount.value,
|
||||
// pass in the registrant's token if your meeting or webinar requires registration. More info here:
|
||||
@ -158,28 +158,21 @@ const checkMedia = async () => {
|
||||
}
|
||||
return result;
|
||||
};
|
||||
// const signature = ref("");
|
||||
const getSignature = async () => {
|
||||
const res = await checkMedia();
|
||||
if (!res.audio || !res.video) {
|
||||
return ElMessageBox.alert(
|
||||
`摄像头状态 : ${res.video ? "可用" : "禁用"}\n麦克风状态 : ${
|
||||
res.audio ? "可用" : "禁用"
|
||||
}`
|
||||
);
|
||||
}
|
||||
console.log(res);
|
||||
axios
|
||||
.post(meetingConfig.signatureEndpoint, {
|
||||
meetingNumber: meetingConfig.meetingNumber,
|
||||
role: meetingConfig.role,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res.data.signature);
|
||||
startMeeting(res.data.signature);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
const { sign } = await generateSignature({
|
||||
meetingNumber: store.getters.meetingNumber,
|
||||
});
|
||||
// signature.value = sign;
|
||||
startMeeting(sign);
|
||||
// const res = await checkMedia();
|
||||
// if (!res.audio || !res.video) {
|
||||
// return ElMessageBox.alert(
|
||||
// `摄像头状态 : ${res.video ? "可用" : "禁用"}\n麦克风状态 : ${
|
||||
// res.audio ? "可用" : "禁用"
|
||||
// }`
|
||||
// );
|
||||
// }
|
||||
};
|
||||
|
||||
const startMeeting = async (signature) => {
|
||||
@ -317,6 +310,7 @@ watch(inSharing, (newVal) => {
|
||||
).style.flexDirection = "";
|
||||
}
|
||||
});
|
||||
|
||||
getSignature();
|
||||
|
||||
// 建立websocket连接
|
||||
|
Reference in New Issue
Block a user