feat: 样式调整
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user