lighter преди 2 години
родител
ревизия
e82f06878c
променени са 4 файла, в които са добавени 4 реда и са изтрити 6 реда
  1. 1 1
      .env.production
  2. 0 3
      src/components/zhu-yuan-yi-sheng/emr/web-socket/EmrWebSocket.vue
  3. 2 1
      src/layout/index.vue
  4. 1 1
      src/utils/websocket.js

+ 1 - 1
.env.production

@@ -1,5 +1,5 @@
 ENV = 'production'
 
 VITE_BASE_URL = 'http://172.16.32.160:8706'
-VITE_SOCKET_URL = 'ws://172.16.32.160:8706/websocket/'
+VITE_SOCKET_URL = 'ws://172.16.32.160:8707/websocket/'
 VITE_EMR_CONTROL_URL = '172.16.32.160:9227'

+ 0 - 3
src/components/zhu-yuan-yi-sheng/emr/web-socket/EmrWebSocket.vue

@@ -189,8 +189,6 @@ const documentChange = (id) => {
       documentSocket = null;
     }
   }
-
-
 }
 
 const initDocumentSocket = () => {
@@ -198,7 +196,6 @@ const initDocumentSocket = () => {
   let temp = SOCKET_URL + documentSid
 
   documentSocket = new WebSocket(temp)
-
   documentSocket.onopen = () => {
     console.log('连接成功')
   }

+ 2 - 1
src/layout/index.vue

@@ -50,7 +50,8 @@ const router = useRouter()
 const initSocket = () => {
   const sid = store.getters['user/sid']
   if (sid && sid !== 'undefined') {
-    initWebSocket(sid + uuid(8, 62))
+    let tempSid = sid.substring(0, sid.length - 8)
+    initWebSocket(tempSid + uuid(8, 62))
   } else {
     router.push('/login')
   }

+ 1 - 1
src/utils/websocket.js

@@ -5,7 +5,6 @@ import store from '@/store'
 
 const socketUrl = import.meta.env.VITE_SOCKET_URL
 
-
 let webSocket = null
 let globalCallback = new Map()
 
@@ -53,6 +52,7 @@ export function initWebSocket(sid, force) {
     webSocket.onopen = function () {
         socketErrDialog.value = false
         store.commit('user/sidChange', sid)
+        console.log('WebSocket连接')
     }
 
     webSocket.onmessage = function (e) {