wujingjing
2025-02-19 404600d8352b4ecac6daf963b63e01bec543fcb3
src/main.ts
@@ -11,8 +11,12 @@
import { initBackEndControlRoutes } from './router/backEnd';
import '/@/theme/index.scss';
import '@amap/amap-jsapi-types';
import { getAllData } from './stores/chatRoom';
import { autoLogin, getAllData ,getGlobalPosition,pingLogin} from './stores/chatRoom';
import { setTheme } from '/@/utils/theme';
import { accessSessionKey } from './utils/request';
import { Local } from './utils/storage';
// setTheme();
const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
   app.component(key, component);
@@ -23,8 +27,15 @@
(async function () {
   await initBackEndControlRoutes();
   const session = Local.get(accessSessionKey);
   if (!session) {
      await autoLogin();
   }
   app.use(pinia).use(router).use(ElementPlus).use(i18n).mount('#app');
})();
// 获取全局数据
getAllData();
pingLogin();
getGlobalPosition();