From 9150b883341ff29fa91b3d1ea55c7fe3c16d9732 Mon Sep 17 00:00:00 2001 From: thiszhc <2029364173@qq.com> Date: Wed, 18 Oct 2023 10:53:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Navbar.vue | 2 ++ src/views/tool/webSocket/index.vue | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 03fcedb..eafaaff 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -98,12 +98,14 @@ import { ComponentInternalInstance } from "vue"; import { TenantVO } from "@/api/types"; import notice from './notice/index.vue'; import useNoticeStore from '@/store/modules/notice'; +import { getToken } from '@/utils/auth'; const appStore = useAppStore(); const userStore = useUserStore(); const settingsStore = useSettingsStore(); const noticeStore = storeToRefs(useNoticeStore()); const newNotice = ref(0); +let websocket = new WebSocket(import.meta.env.VITE_APP_WEBSOCKET_URL + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID); const { proxy } = getCurrentInstance() as ComponentInternalInstance; const userId = ref(userStore.userId); diff --git a/src/views/tool/webSocket/index.vue b/src/views/tool/webSocket/index.vue index 3517666..4452bb0 100644 --- a/src/views/tool/webSocket/index.vue +++ b/src/views/tool/webSocket/index.vue @@ -50,10 +50,6 @@ const start = () => { const sendMessage = () => { sendMsg(conf.send); }; - -onMounted(() => { - start(); -});