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(); -});