Browse Source

统一为eventsouce

master
453530270@qq.com 2 years ago
parent
commit
1651f09228
  1. BIN
      m1013a.zip
  2. 11
      public/config.js
  3. 3
      src/views/HomeView.vue
  4. 3
      src/views/TycView.vue
  5. 4
      src/views/WhView.vue

BIN
m1013a.zip

Binary file not shown.

11
public/config.js

@ -5,13 +5,12 @@ window.publicConfig = {
// WS_URL_WH: 'ws://10.97.121.2/wh',
// WS_URL_ZL: 'ws://10.97.121.2/zl'
BASE_API:'http://61.144.224.21:8443/api',
HOSTURL:'http://61.144.224.21',
EVTZL:"./evtzl",
EVTWH: '/evtwh',
EVTTY: '/evtty',
// socket url
WS_URL_TY: 'ws://61.144.224.21:8443/ty',
WS_URL_WH: 'ws://61.144.224.21:8443/wh',
WS_URL_ZL: 'ws://61.144.224.21:8443/zl'
}
// BASE_API:'http://61.144.224.21:8443/api',
// // socket url
// WS_URL_TY: 'ws://61.144.224.21:8443/ty',
// WS_URL_WH: 'ws://61.144.224.21:8443/wh',
// WS_URL_ZL: 'ws://61.144.224.21:8443/zl'
}

3
src/views/HomeView.vue

@ -697,7 +697,8 @@ export default {
// // console.log("ws connected success!")
// };
// event source
ws = new EventSource("http://www.balib.cn:8442/ws_task_real.php");
const evturl = publicConfig.EVTZL
ws = new EventSource(evturl);
ws.onclose = function(event) {
// console.log('WebSocket');
};

3
src/views/TycView.vue

@ -828,7 +828,8 @@ export default {
getsckdata(){
let that = this;
// websocket
ws = new WebSocket(publicConfig.WS_URL_TY);
const evturl = publicConfig.EVTTY
ws = new EventSource(evturl);
ws.onopen = function() {
// console.log("ws connected success!")
};

4
src/views/WhView.vue

@ -1019,7 +1019,9 @@ export default {
// ws
getsckdata() {
let that = this;
hws = new WebSocket(publicConfig.WS_URL_WH);
const evturl = publicConfig.EVTWH
ws = new EventSource(evturl);
// hws = new WebSocket(publicConfig.WS_URL_WH);
hws.onopen = function () {
// console.log("ws connected success!")
};

Loading…
Cancel
Save