feat: 调整博客页获取数据部分为服务端渲染
Some checks failed
Deploy to K3s / deploy (push) Failing after 1m2s

This commit is contained in:
2025-12-25 15:00:06 +08:00
parent 8dc2473a1c
commit db8d8c429d
3 changed files with 121 additions and 67 deletions

View File

@@ -5,4 +5,14 @@ export async function list() {
return serverFetch<Pick<Blog,
'id' | 'title' | 'description' | 'viewCount' | 'createdAt' | 'updatedAt' | 'deletedAt'
>[]>('/api/blog')
}
export async function getBlog(id: string, password?: string) {
return serverFetch<{
id: string;
title: string;
description: string;
createdAt: string;
content: string;
}>(`/api/blog/${id}` + (password ? `?p=${password}` : ''));
}