添加浏览器ID,确保SSE可同时推送到不同的前端
This commit is contained in:
@@ -34,7 +34,8 @@ export default {
|
||||
sseControl() {
|
||||
let that = this;
|
||||
if (this.alarmNotify) {
|
||||
this.sseSource = new EventSource('/api/emit');
|
||||
console.log("申请SSE推送API调用,浏览器ID: " + this.$browserId);
|
||||
this.sseSource = new EventSource('/api/emit?browserId=' + this.$browserId);
|
||||
this.sseSource.addEventListener('message', function(evt) {
|
||||
that.$notify({
|
||||
title: '收到报警信息',
|
||||
|
||||
Reference in New Issue
Block a user