|
|
@@ -171,14 +171,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
initWebSocket() {
|
|
|
- console.log(window.location.href)
|
|
|
-
|
|
|
- const url =
|
|
|
- window.location.href.indexOf('https') > -1
|
|
|
- ? window.location.href.replace('https', 'wss')
|
|
|
- : window.location.href.replace('http', 'ws')
|
|
|
- const wsuri = url + 'websocket/' + this.user.info.userId
|
|
|
- console.log(wsuri)
|
|
|
+ const wsuri = config.wss + this.user.info.userId
|
|
|
this.websock = new WebSocket(wsuri)
|
|
|
this.websock.onmessage = this.websocketonmessage
|
|
|
// 连接建立时触发
|