Files
jinshen-website/server/api/cms/companyProfile.get.ts
R2m1liA ee1597d2c3
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m54s
fix: 调整URL转换的baseURL
- 将baseURL由directus_url转为directus_public_url
2025-11-14 11:42:29 +08:00

16 lines
456 B
TypeScript

import { companyProfileService } from '~~/server/services/cms/companyProfileService';
export default defineEventHandler(async (event) => {
const locale = getHeader(event, 'x-locale') || 'zh-CN';
const companyProfile = await companyProfileService.getCompanyProfile(locale);
companyProfile.content = rewriteAssetUrls(
companyProfile.content,
useRuntimeConfig().public.directus.publicUrl,
'/api/assets'
);
return companyProfile;
});