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