<!--
 * @Description: 
 * @Author: zenghua.wang
 * @Date: 2024-01-24 18:54:01
 * @LastEditors: zenghua.wang
 * @LastEditTime: 2025-02-28 11:31:12
-->
<template>
  <el-config-provider :size="size" :locale="zhCn">
    <router-view />
  </el-config-provider>
</template>

<script setup name="app">
import { computed, onMounted } from 'vue';
import { useSettingStore } from '@/store/modules/setting';
// 配置element中文
import zhCn from 'element-plus/es/locale/lang/zh-cn';

import { useRouter } from 'vue-router';
const router = useRouter();
onMounted(() => {
  if (localStorage.getItem('source')) {
    router.push('/sub-government-affairs-service/home');
  } else {
    if (JSON.parse(localStorage.getItem('daimp-front-main_userStore')).token) {
      router.push('/sub-government-affairs-service/home');
    } else {
      router.push('/sub-government-affairs-service/login');
    }
  }
});

const SettingStore = useSettingStore();
// 配置全局组件大小
const size = computed(() => SettingStore.themeConfig.globalComSize);
</script>

<style lang="scss">
@import './styles/style';
</style>
