|
@@ -380,16 +380,16 @@ export default {
|
|
|
// }
|
|
|
initWebSocket: function () {
|
|
|
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
|
|
- var userId = this.$store.getters.userid;
|
|
|
-
|
|
|
- var url = process.env.VUE_APP_BASE_API.replace("https://","wss://").replace("http://","ws://").replace("api","supply")+"websocket/"+userId;
|
|
|
- console.debug(userId, url);
|
|
|
- let token = getToken()
|
|
|
- this.websock = new WebSocket(url, [token]);
|
|
|
- this.websock.onopen = this.websocketOnopen;
|
|
|
- this.websock.onerror = this.websocketOnerror;
|
|
|
- this.websock.onmessage = this.websocketOnmessage;
|
|
|
- this.websock.onclose = this.websocketOnclose;
|
|
|
+ // var userId = this.$store.getters.userid;
|
|
|
+ //
|
|
|
+ // var url = process.env.VUE_APP_BASE_API.replace("https://","wss://").replace("http://","ws://").replace("api","supply")+"websocket/"+userId;
|
|
|
+ // console.debug(userId, url);
|
|
|
+ // let token = getToken()
|
|
|
+ // this.websock = new WebSocket(url, [token]);
|
|
|
+ // this.websock.onopen = this.websocketOnopen;
|
|
|
+ // this.websock.onerror = this.websocketOnerror;
|
|
|
+ // this.websock.onmessage = this.websocketOnmessage;
|
|
|
+ // this.websock.onclose = this.websocketOnclose;
|
|
|
},
|
|
|
websocketOnopen: function () {
|
|
|
console.debug("WebSocket连接成功");
|