feat:统一订阅

This commit is contained in:
leilei
2025-11-24 10:10:26 +08:00
parent c9e5ae8da4
commit 6600c7c282
5 changed files with 5 additions and 5 deletions

View File

@@ -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())

View File

@@ -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())

View File

@@ -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);

View File

@@ -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);

View File

@@ -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())