update 重构 common-sse 与 common-websocket 合并为 ruoyi-common-push 推送模块

This commit is contained in:
疯狂的狮子Li
2026-03-26 17:25:36 +08:00
parent 42f63fbe24
commit 5be8fcf571
8 changed files with 139 additions and 135 deletions
+2 -8
View File
@@ -19,8 +19,7 @@ import { AppMain, Navbar, Settings, TagsView } from './components';
import { useAppStore } from '@/store/modules/app';
import { useSettingsStore } from '@/store/modules/settings';
import { NavTypeEnum } from '@/enums/NavTypeEnum';
import { initWebSocket } from '@/utils/websocket';
import { initSSE } from '@/utils/sse';
import { initPush } from '@/utils/push';
const settingsStore = useSettingsStore();
const theme = computed(() => settingsStore.theme);
@@ -61,12 +60,7 @@ watchEffect(() => {
const settingRef = ref<InstanceType<typeof Settings>>();
onMounted(() => {
const protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
initWebSocket(protocol + window.location.host + import.meta.env.VITE_APP_BASE_API + '/resource/websocket');
});
onMounted(() => {
initSSE(import.meta.env.VITE_APP_BASE_API + '/resource/sse');
initPush();
});
const handleClickOutside = () => {