mirror of
https://github.com/Kisechan/Mainpage.git
synced 2025-07-09 14:47:18 +00:00
更新 页面访问次数计数
This commit is contained in:
@ -2,7 +2,11 @@
|
|||||||
<el-footer>
|
<el-footer>
|
||||||
<div class="footer-content">
|
<div class="footer-content">
|
||||||
<div class="footer-text">
|
<div class="footer-text">
|
||||||
<p><a href="https://icp.gov.moe/?keyword=20251453" target="_blank">萌ICP备20251453号</a></p>
|
<p>
|
||||||
|
<a href="https://icp.gov.moe/?keyword=20251453" target="_blank"
|
||||||
|
>萌ICP备20251453号</a
|
||||||
|
>
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
© 2025 By
|
© 2025 By
|
||||||
<a
|
<a
|
||||||
@ -12,16 +16,32 @@
|
|||||||
><strong>Kisechan</strong></a
|
><strong>Kisechan</strong></a
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
<p style="font-size: 0.75em;">
|
<p style="font-size: 0.75em">
|
||||||
Made With <a href="https://cn.vuejs.org/">Vue3</a> & <a href="https://element-plus.org/zh-CN/">Element Plus</a>
|
Made With <a href="https://cn.vuejs.org/">Vue3</a> &
|
||||||
|
<a href="https://element-plus.org/zh-CN/">Element Plus</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="counter" align="center">
|
||||||
|
<span id="my-site-view">本站总访问量:加载中...</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-footer>
|
</el-footer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
// 可以在这里定义一些逻辑
|
import { onMounted } from "vue";
|
||||||
|
const counterJsUrl = import.meta.env.VITE_COUNTER_JS_URL;
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (counterJsUrl) {
|
||||||
|
const script = document.createElement("script");
|
||||||
|
script.async = true;
|
||||||
|
script.src = counterJsUrl;
|
||||||
|
document.body.appendChild(script);
|
||||||
|
} else {
|
||||||
|
console.warn("VITE_COUNTER_JS_URL is not defined");
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@ -38,5 +58,4 @@
|
|||||||
/* .social-icons {
|
/* .social-icons {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -45,6 +45,9 @@
|
|||||||
<a href="https://element-plus.org/zh-CN/">Element Plus</a>
|
<a href="https://element-plus.org/zh-CN/">Element Plus</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="counter" align="center">
|
||||||
|
<span id="my-site-view">本站总访问量:加载中...</span>
|
||||||
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="24" :md="16" :lg="16" :xl="16">
|
<el-col :xs="24" :sm="24" :md="16" :lg="16" :xl="16">
|
||||||
<el-card>
|
<el-card>
|
||||||
@ -134,6 +137,7 @@ import { ref, onMounted } from "vue";
|
|||||||
import GitHubCalendar from "github-calendar"; // 静态导入
|
import GitHubCalendar from "github-calendar"; // 静态导入
|
||||||
|
|
||||||
const feedItems = ref([]);
|
const feedItems = ref([]);
|
||||||
|
const counterJsUrl = import.meta.env.VITE_COUNTER_JS_URL;
|
||||||
|
|
||||||
const loadGitHubCalendar = () => {
|
const loadGitHubCalendar = () => {
|
||||||
const calendarContainerSelector = "#github-graph";
|
const calendarContainerSelector = "#github-graph";
|
||||||
@ -185,11 +189,22 @@ const goToBlog = () => {
|
|||||||
window.open("https://blog.kisechan.space", "_self");
|
window.open("https://blog.kisechan.space", "_self");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const loadCounterScript = () => {
|
||||||
|
if (counterJsUrl) {
|
||||||
|
const script = document.createElement("script");
|
||||||
|
script.async = true;
|
||||||
|
script.src = counterJsUrl;
|
||||||
|
document.body.appendChild(script);
|
||||||
|
} else {
|
||||||
|
console.warn("VITE_COUNTER_JS_URL is not defined");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
loadCounterScript();
|
||||||
loadGitHubCalendar();
|
loadGitHubCalendar();
|
||||||
fetchRSSFeed();
|
fetchRSSFeed();
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
Reference in New Issue
Block a user