- 后台全面引入 Naive UI 组件库,统一 UI 规范 - 前台 usePublicApi 切换到 API 调用(GET /api/content/[key]) - 前后台数据源统一(site_content 表) - 产品线统一管理(tour/camp/course 三套编辑器) - 产品数据归一化(itinerary/faq/pricing 格式统一) - 表单提交 API 改写入 submissions 表 - 新增 submissions 标记已读 API - site-content PUT 支持 upsert - 修复前台 bug(stories 路由冲突、占位符警告、selector breadcrumb) - 消除 PageHero 类型警告(useSEO reactive 修复) - 25 个前台页面全部 HTTP 200,展示效果不变 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
71 行
2.4 KiB
JavaScript
71 行
2.4 KiB
JavaScript
export default defineEventHandler((event) => {
|
|
const pages = [
|
|
{
|
|
url: '/', priority: '1.0', changefreq: 'weekly',
|
|
images: [{ loc: '/images/team/hero-grassland.jpg', title: '呼伦贝尔草原风光 - 呼籁旅行' }],
|
|
},
|
|
{
|
|
url: '/faq', priority: '0.95', changefreq: 'weekly',
|
|
images: [],
|
|
},
|
|
{
|
|
url: '/products', priority: '0.9', changefreq: 'weekly',
|
|
images: [{ loc: '/images/mascot/xiaomengma.png', title: '小蒙马夏令营IP形象' }],
|
|
},
|
|
{
|
|
url: '/about', priority: '0.85', changefreq: 'monthly',
|
|
images: [
|
|
{ loc: '/images/team/hero-family.jpg', title: '呼伦贝尔家庭游合影' },
|
|
{ loc: '/images/team/guide-group.jpg', title: '呼籁旅行领队团队合影' },
|
|
{ loc: '/images/mascot/mascot-front.png', title: '呼籁旅行吉祥物' },
|
|
],
|
|
},
|
|
{
|
|
url: '/reviews', priority: '0.8', changefreq: 'weekly',
|
|
images: [],
|
|
},
|
|
{
|
|
url: '/contact', priority: '0.8', changefreq: 'monthly',
|
|
images: [{ loc: '/images/contact/qrcode-wechat.jpg', title: '呼籁旅行微信客服二维码' }],
|
|
},
|
|
{
|
|
url: '/guides', priority: '0.8', changefreq: 'monthly',
|
|
images: [],
|
|
},
|
|
{
|
|
url: '/summer-camp', priority: '0.85', changefreq: 'monthly',
|
|
images: [
|
|
{ loc: '/images/summer-camp/river-banner.jpg', title: '小蒙马夏令营河畔活动' },
|
|
{ loc: '/images/summer-camp/grassland-group.jpg', title: '草原亲子夏令营合影' },
|
|
{ loc: '/images/summer-camp/birch-group.jpg', title: '白桦林研学活动' },
|
|
{ loc: '/images/summer-camp/camp-graduation.jpg', title: '夏令营结营仪式' },
|
|
],
|
|
},
|
|
]
|
|
|
|
const today = new Date().toISOString().split('T')[0]
|
|
const base = 'https://1814.love'
|
|
|
|
const xml = `<?xml version="1.0" encoding="UTF-8"?>
|
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
|
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
|
|
${pages
|
|
.map(
|
|
(p) => ` <url>
|
|
<loc>${base}${p.url}</loc>
|
|
<lastmod>${today}</lastmod>
|
|
<changefreq>${p.changefreq}</changefreq>
|
|
<priority>${p.priority}</priority>${p.images.map(img => `
|
|
<image:image>
|
|
<image:loc>${base}${img.loc}</image:loc>
|
|
<image:title>${img.title}</image:title>
|
|
</image:image>`).join('')}
|
|
</url>`
|
|
)
|
|
.join('\n')}
|
|
</urlset>`
|
|
|
|
setResponseHeader(event, 'content-type', 'application/xml')
|
|
return xml
|
|
})
|