feat:统一订阅
This commit is contained in:
@@ -131,7 +131,7 @@ defineExpose({
|
|||||||
// onMounted(async () => {
|
// onMounted(async () => {
|
||||||
// await mqttClient.connect(`room${Math.random().toString(16).substr(2, 8)}`);
|
// await mqttClient.connect(`room${Math.random().toString(16).substr(2, 8)}`);
|
||||||
// const res = await userStore.getInfo()
|
// const res = await userStore.getInfo()
|
||||||
// const topic = `xSynergy/ROOM/+/rooms/${res.uid}`;
|
// const topic = `xsynergy/room/+/rooms/${res.uid}`;
|
||||||
// mqttClient.subscribe(topic, async (shapeData) => {
|
// mqttClient.subscribe(topic, async (shapeData) => {
|
||||||
// // console.log(shapeData.toString(),'shapeData发送邀请')
|
// // console.log(shapeData.toString(),'shapeData发送邀请')
|
||||||
// processingSocket(shapeData.toString())
|
// processingSocket(shapeData.toString())
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ function handleClickOutside() {
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await mqttClient.connect(`room${Math.random().toString(16).substr(2, 8)}`);
|
await mqttClient.connect(`room${Math.random().toString(16).substr(2, 8)}`);
|
||||||
const res = await userStore.getInfo()
|
const res = await userStore.getInfo()
|
||||||
const topic = `xSynergy/ROOM/+/rooms/${res.uid}`;
|
const topic = `xsynergy/room/+/rooms/${res.uid}`;
|
||||||
mqttClient.subscribe(topic, async (shapeData) => {
|
mqttClient.subscribe(topic, async (shapeData) => {
|
||||||
if(inviteJoinRef.value){
|
if(inviteJoinRef.value){
|
||||||
inviteJoinRef.value.processingSocket(shapeData.toString())
|
inviteJoinRef.value.processingSocket(shapeData.toString())
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export const WhiteboardSync = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 订阅当前房间
|
// 订阅当前房间
|
||||||
const topic = `xSynergy/ROOM/${roomUid}/whiteboard/#`;
|
const topic = `xsynergy/room/${roomUid}/whiteboard/#`;
|
||||||
mqttClient.subscribe(topic, async (shapeData) => {
|
mqttClient.subscribe(topic, async (shapeData) => {
|
||||||
const shapeDataNew = JSON.parse(shapeData.toString())
|
const shapeDataNew = JSON.parse(shapeData.toString())
|
||||||
// const shapeDataNew = decode(message);
|
// const shapeDataNew = decode(message);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export const WhiteboardSync = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 订阅当前房间
|
// 订阅当前房间
|
||||||
const topic = `xSynergy/ROOM/${roomUid}/whiteboard/#`;
|
const topic = `xsynergy/room/${roomUid}/whiteboard/#`;
|
||||||
mqttClient.subscribe(topic, async (shapeData) => {
|
mqttClient.subscribe(topic, async (shapeData) => {
|
||||||
const shapeDataNew = JSON.parse(shapeData.toString())
|
const shapeDataNew = JSON.parse(shapeData.toString())
|
||||||
// const shapeDataNew = decode(message);
|
// const shapeDataNew = decode(message);
|
||||||
|
|||||||
@@ -500,7 +500,7 @@ const { detail, weekName, tabValue, isShow, load, loadText, isLinkKnow, socketIn
|
|||||||
// onMounted(async () => {
|
// onMounted(async () => {
|
||||||
// await mqttClient.connect(`room${Math.random().toString(16).substr(2, 8)}`);
|
// await mqttClient.connect(`room${Math.random().toString(16).substr(2, 8)}`);
|
||||||
// const res = await userStore.getInfo()
|
// const res = await userStore.getInfo()
|
||||||
// const topic = `xSynergy/ROOM/+/rooms/${res.uid}`;
|
// const topic = `xsynergy/room/+/rooms/${res.uid}`;
|
||||||
// mqttClient.subscribe(topic, async (shapeData) => {
|
// mqttClient.subscribe(topic, async (shapeData) => {
|
||||||
// // console.log(shapeData.toString(),'shapeData发送邀请')
|
// // console.log(shapeData.toString(),'shapeData发送邀请')
|
||||||
// processingSocket(shapeData.toString())
|
// processingSocket(shapeData.toString())
|
||||||
|
|||||||
Reference in New Issue
Block a user