feat: 支持后台配置备案信息

This commit is contained in:
Nixevol
2026-07-05 00:16:47 +08:00
parent b39db6ec01
commit c56ca91edd
10 changed files with 54 additions and 4 deletions
+28 -1
View File
@@ -4,19 +4,36 @@
<h1>{{ t('home.title') }}</h1>
<p class="muted">{{ t('home.hint') }}</p>
<button class="lang" @click="toggleLang">{{ otherLangLabel }}</button>
<footer class="footer muted">
<span>{{ appName }}</span>
<span v-if="filingInfo">{{ filingInfo }}</span>
</footer>
</div>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { computed, onMounted, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { fetchAppInfo } from '@/api';
import { setLocale } from '@/locales';
const { t, locale } = useI18n();
const appName = ref('');
const filingInfo = ref('');
const otherLangLabel = computed(() => (locale.value === 'zh-CN' ? 'EN' : '中文'));
function toggleLang() {
setLocale(locale.value === 'zh-CN' ? 'en-US' : 'zh-CN');
}
onMounted(async () => {
try {
const info = await fetchAppInfo();
appName.value = info?.appName || t('app.name');
filingInfo.value = info?.filingInfo || '';
} catch {
appName.value = t('app.name');
filingInfo.value = '';
}
});
</script>
<style scoped>
@@ -53,4 +70,14 @@ h1 {
padding: 6px 18px;
color: var(--brand);
}
.footer {
position: absolute;
bottom: 28px;
left: 24px;
right: 24px;
display: flex;
flex-direction: column;
gap: 6px;
font-size: 12px;
}
</style>
+10 -1
View File
@@ -268,7 +268,10 @@
<div v-else class="chain-empty muted">{{ t('chain.notOnchain') }}</div>
</section>
<footer class="footer muted">{{ appName }}</footer>
<footer class="footer muted">
<span>{{ appName }}</span>
<span v-if="filingInfo">{{ filingInfo }}</span>
</footer>
</template>
<!-- 轻提示 -->
@@ -293,6 +296,7 @@ const { t, locale } = useI18n();
const loading = ref(true);
const data = ref<any>(null);
const appName = ref('');
const filingInfo = ref('');
const toast = ref('');
// 节点图片默认收缩,避免页面过长;点击展开
@@ -574,10 +578,12 @@ onMounted(async () => {
try {
const info = await fetchAppInfo();
appName.value = info?.appName || t('app.name');
filingInfo.value = info?.filingInfo || '';
const iv = Number(info?.carouselInterval);
if (Number.isFinite(iv) && iv >= 0) carouselInterval.value = iv;
} catch {
appName.value = t('app.name');
filingInfo.value = '';
}
document.addEventListener('click', closeLangMenu);
});
@@ -1126,6 +1132,9 @@ watch(
padding: 8px 0;
}
.footer {
display: flex;
flex-direction: column;
gap: 6px;
text-align: center;
font-size: 12px;
padding: 24px 0 32px;