<script setup lang="ts">
import { GO_URLS } from "cqk-sy-ui";
import { ElConfigProvider } from "element-plus";
import { onMounted } from "vue";
import { $ajax } from "./service";
import { setUrlList } from "./store/mutations";
import globalMount from "@/components/GlobalMount/index.vue";
import zhCn from "element-plus/lib/locale/lang/zh-cn";

onMounted(async () => {
  const res = await $ajax({
    type: "get",
    url: GO_URLS.config,
  });
  if (res) {
    setUrlList(res.data.frontend);
  }
});
</script>

<template>
  <ElConfigProvider :locale="zhCn">
    <router-view :key="$route.path"></router-view>
    <globalMount />
  </ElConfigProvider>
</template>
