feat: 将/support/contact-us由Strapi迁移至Directus

- 修改相关Vue路由
- 添加相应的视图模型与转换方法
This commit is contained in:
2025-10-20 13:13:19 +08:00
parent 440a46850a
commit e48c7fe238
5 changed files with 60 additions and 12 deletions

View File

@ -23,7 +23,7 @@
</div>
<div v-if="!pending" class="page-content">
<markdown-renderer :content="content || ''" />
<markdown-renderer :content="content.content || ''" />
</div>
<div v-else class="loading">
<el-skeleton :rows="5" animated />
@ -32,18 +32,9 @@
</template>
<script setup lang="ts">
const { findOne } = useStrapi();
const { getStrapiLocale } = useLocalizations();
const strapiLocale = getStrapiLocale();
const { data, pending, error } = await useContactInfo();
const { data, pending, error } = useAsyncData('contact-info', () =>
findOne<StrapiContactInfo>('contact-info', undefined, {
populate: '*',
locale: strapiLocale,
})
);
const content = computed(() => data.value?.data.content ?? '');
const content = computed(() => toContactInfoView(data.value));
watch(error, (value) => {
if (value) {