Browse Source

修复调用异常的问题

master
453530270@qq.com 2 years ago
parent
commit
16d2d0db43
  1. BIN
      d1107a.zip
  2. 2
      src/views/TycView.vue
  3. 20
      src/views/WhView.vue

BIN
d1107a.zip

Binary file not shown.

2
src/views/TycView.vue

@ -441,7 +441,7 @@ export default {
this.getTdcg() this.getTdcg()
// ws // ws
// this.getsckdata() this.getsckdata()
}, },
methods: { methods: {
aa(){ aa(){

20
src/views/WhView.vue

@ -375,7 +375,7 @@ export default {
this.libinfoData() this.libinfoData()
// websocket // websocket
// this.getsckdata() this.getsckdata()
}, },
methods: { methods: {
@ -1019,12 +1019,12 @@ export default {
const evturl = publicConfig.EVTWH const evturl = publicConfig.EVTWH
hws = new EventSource(evturl); hws = new EventSource(evturl);
// hws = new WebSocket(publicConfig.WS_URL_WH); // hws = new WebSocket(publicConfig.WS_URL_WH);
hws.onopen = function () { // hws.onopen = function () {
// console.log("ws connected success!") // // console.log("ws connected success!")
}; // };
hws.onclose = function (event) { // hws.onclose = function (event) {
// console.log('WebSocket'); // // console.log('WebSocket');
}; // };
hws.onmessage = (e) => { hws.onmessage = (e) => {
var jstr = JSON.parse(e.data); var jstr = JSON.parse(e.data);
if (!jstr) { if (!jstr) {
@ -1083,8 +1083,8 @@ export default {
}, },
}, },
beforeUnmount() { // beforeUnmount() {
hws.close(); // hws.close();
} // }
} }
</script> </script>
Loading…
Cancel
Save