提交正式官网

This commit is contained in:
parkiss
2026-07-09 14:35:32 +08:00
parent 5efbd6760e
commit e09f0eccda
792 changed files with 91499 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import { getPageSeoByRoute } from '~/server/utils/page-seo'
import { fail, ok } from '~/server/utils/response'
export default defineEventHandler(async (event) => {
const query = getQuery(event)
const routeKey = String(query.routeKey || query.route_key || '').trim()
const localeRaw = String(query.locale || 'en').trim()
if (!routeKey) {
setResponseStatus(event, 400)
return fail('缺少 routeKey 参数', 400)
}
const locale = localeRaw === 'zh' ? 'zh' : 'en'
const record = await getPageSeoByRoute(routeKey, locale)
if (!record) {
setResponseStatus(event, 404)
return fail('未找到 SEO 配置', 404)
}
return ok(record)
})