<script setup>
import { RouterView } from 'vue-router';
import { onBeforeMount, onMounted } from 'vue';
import http from '@/io/http';
import { showToast } from 'vant';
import { useWebsite } from '@/stores/website';

const website = useWebsite();

onBeforeMount(() => {
  http('/api/web/setting', {}, 'get').then(res => {
    document.title = res.data.web_title;
    website.updateInfo(res.data);
  }).catch(err => {
    showToast(err.message);
  });
});

</script>

<template>
  <RouterView />
</template>

<style scoped></style>
