<script setup lang="ts">
import { useStore } from "./stores/index";
const store = useStore();

const time = ref();


onMounted(() => {
  // @ts-ignore
  store.dataAll = dataAll;
  // 移动端
  window.addEventListener(
    "resize",
    () => {
      //@ts-ignore
      clearTimeout(time.current);
      //@ts-ignore
      time.current = window.setTimeout(() => {
        // 根元素
        const dom: HTMLDivElement | null = document.querySelector("#app");
        if (dom && document.documentElement.clientWidth < 480) {
          dom.style.height = document.documentElement.clientHeight + "px";
        }
      }, 100);
    },
    true
  );

  // const baseAPIUrl = ref('')
  // // const baseAPIUrl = ref('http://192.168.20.61:8063')
  // // const baseAPIUrl = ref('https://sit-cnzhengquan.4dage.com')

  // // 统计访问量
  // if (localStorage.getItem('refreshTime')) {
  //   var nowDate = Math.floor(Date.now() / 1000);
  //   // @ts-ignore
  //   var storedTimestamp = parseInt(localStorage.getItem('refreshTime'), 10);
  //   console.log('时间差',Math.floor((nowDate - storedTimestamp)))
  //   if (Math.floor((nowDate - storedTimestamp) / 60) > 60) {
  //     // 发送请求并且更新本地缓存

  //     axios.get(`${baseAPIUrl.value}/api/show/addVisit?id=10&type=visit`).then(() => {
  //       // @ts-ignore
  //       localStorage.setItem('refreshTime', nowDate);
  //     })
  //   }
  // } else {
  //   axios.get(`${baseAPIUrl.value}/api/show/addVisit?id=10&type=visit`).then(() => {
  //     // @ts-ignore
  //     localStorage.setItem('refreshTime', Math.floor(Date.now() / 1000));
  //   })

  // }
})
</script>

<template>
  <router-view />
</template>

<style scoped>
@font-face {
  font-family: 'REEJI-DuoguanGB-free-Flash';
  src: url('./assets/fonts/REEJI-DuoguanGB-free-Flash.ttf');
}

@font-face {
  font-family: 'SourceHanSansCN-Bold';
  src: url('./assets/fonts/SourceHanSansCN-Bold.otf');
}

@font-face {
  font-family: 'PangMenZhengDao-Regular';
  src: url('./assets/fonts/PangMenZhengDao-Regular.ttf');
}

@font-face {
  font-family: 'SourceHanSerifCN-Heavy';
  src: url('./assets/fonts/SourceHanSerifCN-Heavy.otf');
}



#app {
  width: 100%;
  height: 100%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
</style>
