兰宝车间质量管理系统-前端
ahao
2024-01-05 6432d165c71213f90cda5c4ae250dd5b83a8cc05
src/layout/index.vue
@@ -26,6 +26,7 @@
import { AppMain, Navbar, Settings, TagsView } from './components';
import useAppStore from '@/store/modules/app';
import useSettingsStore from '@/store/modules/settings';
import { initWebSocket } from '@/utils/websocket';
const settingsStore = useSettingsStore();
const theme = computed(() => settingsStore.theme);
@@ -65,6 +66,11 @@
  });
});
onMounted(() => {
  let protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
  initWebSocket(protocol + window.location.host + import.meta.env.VITE_APP_BASE_API + '/resource/websocket');
});
const handleClickOutside = () => {
  useAppStore().closeSideBar({ withoutAnimation: false });
};