feat: 将/about界面由Strapi迁移至Directus

- 修改相关路由界面
- 增添相应的视图模型与转换方法
This commit is contained in:
2025-10-20 13:48:57 +08:00
parent faf2eb4b44
commit c156d1414c
5 changed files with 60 additions and 11 deletions

View File

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

View File

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