|
|
@@ -1,4 +1,5 @@
|
|
|
<script setup lang="ts">
|
|
|
+import axios from "axios";
|
|
|
import { useStore } from "./stores/index";
|
|
|
const store = useStore();
|
|
|
|
|
|
@@ -48,6 +49,32 @@ onMounted(() => {
|
|
|
},
|
|
|
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>
|
|
|
|
|
|
@@ -60,6 +87,7 @@ onMounted(() => {
|
|
|
font-family: 'AlibabaPuHuiTi2.0-105Heavy';
|
|
|
src: url('./assets/fonts/AlibabaPuHuiTi2.0-105Heavy.ttf');
|
|
|
}
|
|
|
+
|
|
|
@font-face {
|
|
|
font-family: 'AlibabaPuHuiTi2.0-75SemiBold';
|
|
|
src: url('./assets/fonts/AlibabaPuHuiTi2.0-75SemiBold.ttf');
|