提交: 监控大屏 添加ws guid 唯一值
This commit is contained in:
parent
03ee1d17f7
commit
9f541a4156
|
@ -240,6 +240,15 @@ export default {
|
||||||
this.projectSpaceCensusList = res.data || [];
|
this.projectSpaceCensusList = res.data || [];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getGuid() {
|
||||||
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(
|
||||||
|
c
|
||||||
|
) {
|
||||||
|
var r = (Math.random() * 16) | 0,
|
||||||
|
v = c == "x" ? r : (r & 0x3) | 0x8;
|
||||||
|
return v.toString(16);
|
||||||
|
});
|
||||||
|
},
|
||||||
// 创建一个ws 监听获取报警实时数据
|
// 创建一个ws 监听获取报警实时数据
|
||||||
connection() {
|
connection() {
|
||||||
if (this.stompClient) {
|
if (this.stompClient) {
|
||||||
|
@ -249,7 +258,7 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.stompClient = new WebSocket(
|
this.stompClient = new WebSocket(
|
||||||
`${bigWebSocketUrl}/${this.projectId || -1}`
|
`${bigWebSocketUrl}/${this.getGuid()}/${this.projectId || -1}`
|
||||||
);
|
);
|
||||||
this.stompClient.onmessage = this.socket_onmsg;
|
this.stompClient.onmessage = this.socket_onmsg;
|
||||||
this.stompClient.onclose = this.socket_onclose;
|
this.stompClient.onclose = this.socket_onclose;
|
||||||
|
|
Loading…
Reference in New Issue