feat: 修复时区问题

This commit is contained in:
2026-07-07 23:49:06 +08:00
parent 3c9ef565b3
commit 4fe81f1e48
3 changed files with 25 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
---
import Layout from "@/layouts/Layout.astro";
import { http } from "@/lib/request";
import {http} from "@/lib/request";
import {formatDatetime} from "@/lib/format.ts";
interface Post {
@@ -9,6 +9,7 @@ interface Post {
summary: string;
slug: string;
cover: string;
category_name: string;
published_at: string;
}
@@ -24,12 +25,13 @@ const {list} = await http.get<ApiPageResponse<Post>>("post");
href={`/posts/${post.slug}`}
>
<div class="cover">
<img src={post.cover} alt={post.title} />
<img src={post.cover} alt={post.title}/>
</div>
<div class="post-content">
<h2>{post.title}</h2>
<p class="summary">{post.summary}</p>
<div>{formatDatetime(post.published_at,'YYYY 年 MM 月 DD 日')}</div>
<p class="summary">summary:{post.summary}</p>
<p class="summary">category_name:{post.category_name}</p>
<div>{formatDatetime(post.published_at, 'YYYY 年 MM 月 DD 日')}</div>
</div>
</a>
))
@@ -53,8 +55,8 @@ const {list} = await http.get<ApiPageResponse<Post>>("post");
gap: 20px;
}
.post-content{
flex:1;
.post-content {
flex: 1;
overflow: hidden;
}
@@ -63,7 +65,7 @@ const {list} = await http.get<ApiPageResponse<Post>>("post");
color: rgb(66, 63, 63);
}
.cover{
.cover {
width: 250px;
height: 150px;
border-radius: 8px;