wujingjing
2025-02-27 1b79ef8bf28dc6e1252b3f129b60095c46a6765f
src/stores/global.ts
@@ -1,7 +1,11 @@
import type { Ref } from 'vue';
import { ref } from 'vue';
import { GetSystemGlobalConfig } from '../api/system';
import { SSE_URL } from '../constants';
import { accessSessionKey } from '../utils/request';
import { SSEClient } from '../utils/sse/SSEClient';
import { Local } from '../utils/storage';
import type { SystemGlobalConfig } from '../views/types';
/**
 * 连接消息同步服务
@@ -22,6 +26,18 @@
   return sseClient;
};
// export const sseClient = connectMsgSyncService();
export const sseClient = null;
export const sseClient = connectMsgSyncService();
/** @description 系统全局配置 */
export const systemGlobalConfig: Ref<SystemGlobalConfig> = ref({} as SystemGlobalConfig);
/**
 * 获取系统全局配置
 * @returns
 */
export const getSystemGlobalConfig = async () => {
   const res = await GetSystemGlobalConfig({
      config_key_list: ['ui.project_city'].join(','),
   });
   systemGlobalConfig.value = res.values ?? {};
};