兰宝车间质量管理系统-前端
疯狂的狮子Li
2023-12-23 597f2b4461eb38626cfcfc243ca0eefaf076069c
src/layout/index.vue
@@ -27,6 +27,14 @@
import useAppStore from '@/store/modules/app';
import useSettingsStore from '@/store/modules/settings';
import { initWebSocket } from '@/utils/websocket';
import useNoticeStore from '@/store/modules/notice';
onMounted(() => {
  let protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
  initWebSocket(protocol + window.location.host + import.meta.env.VITE_APP_BASE_API + '/resource/websocket', useNoticeStore());
});
const settingsStore = useSettingsStore();
const theme = computed(() => settingsStore.theme);
const sidebar = computed(() => useAppStore().sidebar);