This commit is contained in:
2025-12-28 00:25:31 +08:00
parent ee5dfe064d
commit f40d478c68
10 changed files with 12636 additions and 33914 deletions

View File

@@ -4,6 +4,7 @@
<!-- 一言 -->
<p v-if="showHitokoto && quote" class="text-text-muted text-sm m-0 italic">
{{ quote }}<span v-if="from" class="ml-1.5"> {{ from }}</span>
<span v-if="from && fromWho" class="ml-1.5"> · {{ fromWho }}</span>
</p>
<!-- 访问统计 -->
@@ -61,6 +62,7 @@ const contact = siteConfig.footer || {};
const config = useRuntimeConfig();
const quote = ref("");
const from = ref("");
const fromWho = ref("");
const pageviews = ref(0);
const visitors = ref(0);
const statsError = ref(true);
@@ -86,8 +88,10 @@ const fetchHitokoto = async () => {
try {
const resp = await fetch(buildHitokotoUrl());
const data = await resp.json();
console.log(data);
quote.value = data.hitokoto || "";
from.value = data.from || "";
fromWho.value = data.from_who || "";
} catch (e) {
console.warn("Hitokoto fetch failed", e);
}