From 4310e5e049ceff181d7728d8223d14b356ebea61 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期五, 08 十一月 2024 00:33:45 +0800 Subject: [PATCH] update 优化代码格式 --- src/utils/websocket.ts | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/websocket.ts b/src/utils/websocket.ts index ade13ef..c9b394c 100644 --- a/src/utils/websocket.ts +++ b/src/utils/websocket.ts @@ -7,7 +7,7 @@ if (import.meta.env.VITE_APP_WEBSOCKET === 'false') { return; } - url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID + url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID; useWebSocket(url, { autoReconnect: { // 閲嶈繛鏈�澶ф鏁� @@ -16,14 +16,14 @@ delay: 1000, onFailed() { console.log('websocket閲嶈繛澶辫触'); - }, + } }, heartbeat: { - message: JSON.stringify({type: 'ping'}), + message: JSON.stringify({ type: 'ping' }), // 鍙戦�佸績璺崇殑闂撮殧 interval: 10000, // 鎺ユ敹鍒板績璺硆esponse鐨勮秴鏃舵椂闂� - pongTimeout: 2000, + pongTimeout: 2000 }, onConnected() { console.log('websocket宸茬粡杩炴帴'); -- Gitblit v1.9.3