Browse Source

通用获取ws的方法

master
453530270@qq.com 3 years ago
parent
commit
c55e85b448
  1. 12
      src/utils/comm.js

12
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;
};
}
Loading…
Cancel
Save