chenyc
2022-07-15 6f509dd2ad48541331a115aa8f59e55dd351ed13
src/samples/sockteStomp.ts
@@ -176,27 +176,24 @@
        stompClient.send(`/app/workstation/config/set/${clientCode}/${pcName}`,{},JSON.stringify({"clientCode":clientCode,"machineName":pcName}))
        
    }
<<<<<<< HEAD
    // 更新sockte链接状态
    sockteStore().setsockteIsLink(true)
    console.log(sockteStore().isLink)
    if(devices!==undefined&&devices.length>0){
=======
    // 更新sockte链接状态
    sockteStore().setsockteIsLink(true)
    console.log(sockteStore().isLink)
    console.log(devices)
    if(devices!==undefined&&devices!=null &&devices.length>0){
>>>>>>> 5fc7472d0ec6bff69b874f33eeccc30541f7f6df
        devices.forEach(de=>{
            if(stompClient!==null){
                stompClient.subscribe(`/queue/${clientCode}/${de.deviceName}/result`,callback)
                // stompClient.subscribe(`/queue/${clientCode}/${de.deviceName}/keepalive`,callbackState)
                stompClient.send(`/app/device/request/${clientCode}/${de.deviceName}`, {}, JSON.stringify({"deviceNumber":de.deviceName}));
        // 更新sockte链接状态
        sockteStore().setsockteIsLink(true)
        console.log(sockteStore().isLink)
        console.log(devices)
        if(devices!==undefined&&devices!=null &&devices.length>0){
            devices.forEach(de=>{
                if(stompClient!==null){
                    stompClient.subscribe(`/queue/${clientCode}/${de.deviceName}/result`,callback)
                    // stompClient.subscribe(`/queue/${clientCode}/${de.deviceName}/keepalive`,callbackState)
                    stompClient.send(`/app/device/request/${clientCode}/${de.deviceName}`, {}, JSON.stringify({"deviceNumber":de.deviceName}));
            }
        })
                }
            })
        }
    }
}