订阅处理
This commit is contained in:
parent
cdcad825f7
commit
33292ca9b8
@ -267,12 +267,12 @@ export function cancelSubscribe(lineApp: IGraphicApp) {
|
||||
if (lineId) {
|
||||
lineApp.unsubscribe(`/queue/line/${lineId}/device`);
|
||||
lineApp.unsubscribe(`/queue/line/${lineId}/train`);
|
||||
const userStore = useUserStore();
|
||||
getMonitorPath(userStore.roles).destinations.forEach((destination) => {
|
||||
monitorDestinations.forEach((destination) => {
|
||||
lineApp.unsubscribe(destination);
|
||||
});
|
||||
}
|
||||
}
|
||||
let monitorDestinations: string[] = [];
|
||||
function handleSubscribe(lineApp: IGraphicApp) {
|
||||
const lineStore = useLineStore();
|
||||
const lineId = lineStore.lineId;
|
||||
@ -327,7 +327,8 @@ function handleSubscribe(lineApp: IGraphicApp) {
|
||||
});
|
||||
const lineNetStore = useLineNetStore();
|
||||
const userStore = useUserStore();
|
||||
getMonitorPath(userStore.roles).destinations.forEach((destination) => {
|
||||
monitorDestinations = getMonitorPath(userStore.roles).destinations;
|
||||
monitorDestinations.forEach((destination) => {
|
||||
lineApp.subscribe({
|
||||
destination,
|
||||
messageHandle: (message: Uint8Array) => {
|
||||
|
@ -151,11 +151,12 @@ export async function loadLineNetDatas(): Promise<IGraphicStorage> {
|
||||
|
||||
export function cancelSubscribe(lineNetApp: IGraphicApp) {
|
||||
lineNetApp.unsubscribe('/queue/lineNet');
|
||||
const userStore = useUserStore();
|
||||
getMonitorPath(userStore.roles).destinations.forEach((destination) => {
|
||||
monitorDestinations.forEach((destination) => {
|
||||
lineNetApp.unsubscribe(destination);
|
||||
});
|
||||
}
|
||||
|
||||
let monitorDestinations: string[] = [];
|
||||
export function handleSubscribe(lineNetApp: IGraphicApp) {
|
||||
const lineNetStore = useLineNetStore();
|
||||
lineNetApp.enableWsMassaging({
|
||||
@ -175,7 +176,8 @@ export function handleSubscribe(lineNetApp: IGraphicApp) {
|
||||
},
|
||||
});
|
||||
const userStore = useUserStore();
|
||||
getMonitorPath(userStore.roles).destinations.forEach((destination) => {
|
||||
monitorDestinations = getMonitorPath(userStore.roles).destinations;
|
||||
monitorDestinations.forEach((destination) => {
|
||||
lineNetApp.subscribe({
|
||||
destination,
|
||||
messageHandle: (message: Uint8Array) => {
|
||||
|
Loading…
Reference in New Issue
Block a user