修改webscoket接口为用户id

This commit is contained in:
fengachen
2021-09-29 16:54:31 +08:00
parent f0448340b3
commit 8feaf92849
+2 -2
View File
@@ -180,9 +180,9 @@
initWebSocket: function () {
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
var userPhone = store.getters.userInfo.phone
var userId = store.getters.userInfo.id
console.log('store.getters.userInfo',store.getters.userInfo)
var url = window._CONFIG['domianWebSocketURL'].replace('https://','wss://').replace('http://','ws://')+'/websocket/'+userPhone
var url = window._CONFIG['domianWebSocketURL'].replace('https://','wss://').replace('http://','ws://')+'/websocket/'+userId
//console.log(url);
this.websock = new WebSocket(url)
this.websock.onopen = this.websocketOnopen