mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 10:29:20 +08:00
feat: 抽出sse实时连接服务,导入进度和同步进度共用公共sse连接
This commit is contained in:
@@ -19,7 +19,7 @@ import { useAccessStore, useUserStore } from '@vben/stores';
|
||||
import ImportTaskButton from '#/components/ImportTaskButton.vue';
|
||||
import SwitchAccountModal from '#/components/SwitchAccountModal.vue';
|
||||
import SwitchCompanyModal from '#/components/SwitchCompanyModal.vue';
|
||||
import { useAuthStore, useImportTaskStore } from '#/store';
|
||||
import { useAuthStore, useImportTaskStore, useRealtimeStore } from '#/store';
|
||||
import LoginForm from '#/views/_core/authentication/login.vue';
|
||||
|
||||
const router = useRouter();
|
||||
@@ -59,13 +59,15 @@ const userStore = useUserStore();
|
||||
const authStore = useAuthStore();
|
||||
const accessStore = useAccessStore();
|
||||
const importTaskStore = useImportTaskStore();
|
||||
const realtimeStore = useRealtimeStore();
|
||||
const { destroyWatermark, updateWatermark } = useWatermark();
|
||||
const showDot = computed(() =>
|
||||
notifications.value.some((item) => !item.isRead),
|
||||
);
|
||||
|
||||
// 初始化导入任务store
|
||||
// 登录布局挂载:先建用户级 SSE,再拉导入任务
|
||||
onMounted(() => {
|
||||
realtimeStore.start();
|
||||
importTaskStore.init();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user