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

@ -6,3 +6,4 @@ export * from './useSolutionList';
export * from './useSolution';
export * from './useQuestionList';
export * from './useDocumentList';
export * from './useContactInfo';

View File

@ -0,0 +1,29 @@
import { readSingleton } from '@directus/sdk';
export const useContactInfo = () => {
const { $directus } = useNuxtApp();
const { getDirectusLocale } = useLocalizations();
const locale = getDirectusLocale();
return useAsyncData(`contact-info-${locale}`, async () => {
return await $directus.request(
readSingleton('contact_info', {
fields: [
'id',
{
translations: ['id', 'content'],
},
],
deep: {
translations: {
_filter: {
languages_code: {
_eq: locale,
},
},
},
},
})
);
});
};