feat: 内部署名改为编译期注入(构建机本地文件,不进仓库);关于页展示

This commit is contained in:
AskaEth committed 2026-09-09 20:07:59 +08:00
1 parent d288e2bb22
commit 76e725ca96
6 files changed
+66 -1

No files matched your search

+20
View File
@@ -72,6 +72,9 @@ const port = computed(() => {
const origin = computed(() => window.location.origin)
// 内部署名由构建期注入,只有登录后(recorder+)才拿得到;未注入时为空串
const internalSignature = ref('')
onMounted(async () => {
// 直接从 /api/health 取版本;不走 adminApi.health 的示例数据兜底,避免把 mock 当成真实版本
try {
@@ -83,6 +86,16 @@ onMounted(async () => {
versionChecked.value = true
}
try {
const res = await fetch('/api/system/about', { credentials: 'include' })
if (res.ok) {
const body = (await res.json()) as { ok: boolean; data?: { internalSignature?: string } }
internalSignature.value = body.data?.internalSignature ?? ''
}
} catch {
// 未登录 / 接口不可达都按「没有署名」处理,不打扰用户
}
if (!data.loaded) void data.load()
})
</script>
@@ -99,6 +112,13 @@ onMounted(async () => {
</div>
</div>
<div v-if="internalSignature" class="mx-card" style="margin-bottom: 16px">
<div class="mx-card-body" style="display: flex; flex-direction: column; gap: 4px">
<span style="font-size: 12px; color: var(--mx-t3)">内部署名</span>
<strong style="font-size: 15px">{{ internalSignature }}</strong>
</div>
</div>
<section class="mx-card">
<div class="mx-card-head">
<span class="mx-card-title">基本信息</span>