feat: 样式调整

This commit is contained in:
2026-07-21 18:14:41 +08:00
parent 60d8f66ad0
commit 634824ff44
12 changed files with 161 additions and 133 deletions

View File

@@ -1,23 +1,29 @@
---
import Layout from "@/layouts/Layout.astro";
import IndexView from "@/components/IndexView.astro";
import type {Post, CategoriesStats} from "@/types/post";
import {createHttp} from "@/lib/request";
import {metadata} from "@/consts.ts";
import type { Post, CategoriesStats } from "@/types/post";
import { createHttp } from "@/lib/request";
import { metadata } from "@/consts.ts";
const http = createHttp(Astro.request.headers)
const http = createHttp(Astro.request.headers);
const {list, total} = await http.get<ApiPageResponse<Post>>("post", {
const { list, total } = await http.get<ApiPageResponse<Post>>("post", {
searchParams: {
page: 1,
page_size: metadata.postPageSize
}
page_size: metadata.postPageSize,
},
});
const totalPage = Math.ceil(total / metadata.postPageSize)
const totalPage = Math.ceil(total / metadata.postPageSize);
const {data: categories} = await http.get<ApiResponse<CategoriesStats[]>>("category/stats");
const { data: categories } =
await http.get<ApiResponse<CategoriesStats[]>>("category/stats");
---
<Layout>
<IndexView categories={categories} posts={list} page={1} totalPage={totalPage}/>
<IndexView
categories={categories}
posts={list}
page={1}
totalPage={totalPage}
/>
</Layout>