add: sitemap

This commit is contained in:
ctwj
2025-11-21 01:47:02 +08:00
parent 6c84b8d7b7
commit 8708e869a4
11 changed files with 1133 additions and 9 deletions

View File

@@ -404,6 +404,27 @@ export const useWechatApi = () => {
}
}
// Sitemap管理API
export const useSitemapApi = () => {
const getSitemapConfig = () => useApiFetch('/sitemap/config').then(parseApiResponse)
const updateSitemapConfig = (data: any) => useApiFetch('/sitemap/config', { method: 'POST', body: data }).then(parseApiResponse)
const generateSitemap = () => useApiFetch('/sitemap/generate', { method: 'POST' }).then(parseApiResponse)
const getSitemapStatus = () => useApiFetch('/sitemap/status').then(parseApiResponse)
const fullGenerateSitemap = () => useApiFetch('/sitemap/full-generate', { method: 'POST' }).then(parseApiResponse)
const getSitemapIndex = () => useApiFetch('/sitemap.xml')
const getSitemapPage = (page: number) => useApiFetch(`/sitemap-${page}.xml`)
return {
getSitemapConfig,
updateSitemapConfig,
generateSitemap,
getSitemapStatus,
fullGenerateSitemap,
getSitemapIndex,
getSitemapPage
}
}
// 统一API访问函数
export const useApi = () => {
return {
@@ -425,6 +446,7 @@ export const useApi = () => {
meilisearchApi: useMeilisearchApi(),
apiAccessLogApi: useApiAccessLogApi(),
systemLogApi: useSystemLogApi(),
wechatApi: useWechatApi()
wechatApi: useWechatApi(),
sitemapApi: useSitemapApi()
}
}