diff --git a/src/utils/comm.js b/src/utils/comm.js index ba372b6..ba4fb6e 100644 --- a/src/utils/comm.js +++ b/src/utils/comm.js @@ -32,4 +32,16 @@ export function ecMaxVal(arr){ narr[i]=maxval+267 } return narr; +} + +// websoket +// 查询的参数封装成json +export function rtsocket(param){ + ws = new WebSocket("ws://10.97.121.2/ws"); + ws.onopen = function() { + ws.send(JSON.stringify(param)) + }; + ws.onmessage = function(e) { + return e.data; + }; } \ No newline at end of file