瀏覽代碼

:arrow_up: Upgrading dependencies.更换stomp websocket包,移除远古包net,关闭websocket日志

lishangbu 6 年之前
父節點
當前提交
98dac95ce1
共有 2 個文件被更改,包括 4 次插入5 次删除
  1. 1 2
      package.json
  2. 3 3
      src/page/index/index.vue

+ 1 - 2
package.json

@@ -18,11 +18,10 @@
     "echarts": "^4.2.1",
     "element-ui": "~2.9.1",
     "js-cookie": "^2.2.0",
-    "net": "^1.0.2",
     "nprogress": "^0.2.0",
     "script-loader": "^0.7.2",
     "sockjs-client": "^1.0.0",
-    "stompjs": "^2.3.3",
+    "stomp-websocket": "^2.3.4-next",
     "vue": "^2.6.10",
     "vue-axios": "^2.1.2",
     "vue-clipboard2": "^0.3.0",

+ 3 - 3
src/page/index/index.vue

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