From a5931a78f6fcf1da2dc5a3bfa243397d01acb6a6 Mon Sep 17 00:00:00 2001 From: admin_lijinfu <lijinfu@outlook.com> Date: 星期日, 24 十一月 2024 21:49:13 +0800 Subject: [PATCH] perf: permission loadView避免整个modules循环,允许view中间有views文件夹 --- src/utils/sse.ts | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/utils/sse.ts b/src/utils/sse.ts index a08f282..5234648 100644 --- a/src/utils/sse.ts +++ b/src/utils/sse.ts @@ -2,11 +2,13 @@ import { ElNotification } from 'element-plus'; import useNoticeStore from '@/store/modules/notice'; -let message = ''; - // 鍒濆鍖� export const initSSE = (url: any) => { - url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID + 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 @@ -15,13 +17,13 @@ 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; }); @@ -41,5 +43,3 @@ data.value = null; }); }; - - -- Gitblit v1.9.3