瀏覽代碼

ws连接方式

CzRger 6 天之前
父節點
當前提交
d611a8effe
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/views/web/archive/index.vue
  2. 1 1
      src/views/web/list/index.vue

+ 1 - 1
src/views/web/archive/index.vue

@@ -307,7 +307,7 @@ watch(() => state.activeTab, (n) => {
   }
 })
 const initWS = () => {
-  const ws: any = new WebSocket('/ws-api/smart-ws?userId=1388061846031220738')
+  const ws: any = new WebSocket(`ws://${location.host}/ws-api/smart-ws?userId=${AppStore.userInfo.id}`)
   let sessionId = ''
   let lastTabParams = ''
   let lastMainParams = ''

+ 1 - 1
src/views/web/list/index.vue

@@ -454,7 +454,7 @@ const initWS = () => {
     text: '搜索服务连接中……',
     background: ThemeStore.loadingBg
   })
-  const ws: any = new WebSocket('/ws-api/smart-ws?userId=1388061846031220738')
+  const ws: any = new WebSocket(`ws://${location.host}/ws-api/smart-ws?userId=${AppStore.userInfo.id}`)
   let sessionId = ''
   let lastCountParams = ''
   let lastCountStep = 0