|
@@ -42,8 +42,8 @@ import top from './top/'
|
|
import sidebar from './sidebar/'
|
|
import sidebar from './sidebar/'
|
|
import admin from '@/util/admin'
|
|
import admin from '@/util/admin'
|
|
import { getStore } from '@/util/store.js'
|
|
import { getStore } from '@/util/store.js'
|
|
-import SockJS from 'sockjs-client'
|
|
|
|
-import Stomp from 'stompjs'
|
|
|
|
|
|
+import * as SockJS from 'sockjs-client'
|
|
|
|
+import Stomp from 'stomp-websocket'
|
|
import store from '@/store'
|
|
import store from '@/store'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -138,7 +138,7 @@ export default {
|
|
this.socket = new SockJS('/act/ws')// 连接服务端提供的通信接口,连接以后才可以订阅广播消息和个人消息
|
|
this.socket = new SockJS('/act/ws')// 连接服务端提供的通信接口,连接以后才可以订阅广播消息和个人消息
|
|
// 获取STOMP子协议的客户端对象
|
|
// 获取STOMP子协议的客户端对象
|
|
this.stompClient = Stomp.over(this.socket)
|
|
this.stompClient = Stomp.over(this.socket)
|
|
-
|
|
|
|
|
|
+ this.stompClient.debug=null
|
|
// 向服务器发起websocket连接
|
|
// 向服务器发起websocket连接
|
|
this.stompClient.connect(headers, () => {
|
|
this.stompClient.connect(headers, () => {
|
|
this.stompClient.subscribe('/task/' + this.userInfo.username + '-' + TENANT_ID + '/remind', (msg) => { // 订阅服务端提供的某个topic;
|
|
this.stompClient.subscribe('/task/' + this.userInfo.username + '-' + TENANT_ID + '/remind', (msg) => { // 订阅服务端提供的某个topic;
|