From 5e440a7dc434c43eb828fa62cf9c12b0078b8565 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期一, 20 一月 2025 11:36:18 +0800
Subject: [PATCH] !173 发布 5.3.0-BETA 公测版本 Merge pull request !173 from 疯狂的狮子Li/dev

---
 src/utils/sse.ts |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/utils/sse.ts b/src/utils/sse.ts
index 7db4aa7..69447ad 100644
--- a/src/utils/sse.ts
+++ b/src/utils/sse.ts
@@ -2,29 +2,25 @@
 import { ElNotification } from 'element-plus';
 import useNoticeStore from '@/store/modules/notice';
 
-let message = '';
-
 // 鍒濆鍖�
 export const initSSE = (url: any) => {
-  if (import.meta.env.VITE_APP_WEBSOCKET === 'false') {
+  if (import.meta.env.VITE_APP_SSE === 'false') {
     return;
   }
-  url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID
-  const {
-    data,
-    error
-  } = useEventSource(url, [], {
+
+  url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID;
+  const { data, error } = useEventSource(url, [], {
     autoReconnect: {
       retries: 10,
       delay: 3000,
       onFailed() {
-        console.log('Failed to connect after 10 retries')
-      },
+        console.log('Failed to connect after 10 retries');
+      }
     }
   });
 
   watch(error, () => {
-    console.log('SSE connection error:', error.value)
+    console.log('SSE connection error:', error.value);
     error.value = null;
   });
 
@@ -44,5 +40,3 @@
     data.value = null;
   });
 };
-
-

--
Gitblit v1.9.3