From 60082aca6f9ce82766fb702f2dc6cb0fa3eb4ed6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 30 Dec 2025 20:16:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=B6=E9=97=B4=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=92=8C=E5=9B=BE=E5=83=8F=E6=8B=93=E5=B1=95=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加formatBeijingTime函数,将所有时间显示转换为北京时间(UTC+8) - 更新相册、管理后台、精选页面的时间显示 - 图像拓展功能改为直接发送图片URL而不是base64 - 优化API性能,减少数据传输量 --- .../settings/admin-settings-client.tsx | 3 +- app/(chat)/featured/page.tsx | 3 +- app/(chat)/gallery/page.tsx | 5 +- app/api/extend/route.ts | 105 +++++++++++++++--- components/image-annotator.tsx | 10 +- lib/utils.ts | 37 ++++++ 6 files changed, 136 insertions(+), 27 deletions(-) diff --git a/app/(admin)/settings/admin-settings-client.tsx b/app/(admin)/settings/admin-settings-client.tsx index 18d77ae..7321251 100644 --- a/app/(admin)/settings/admin-settings-client.tsx +++ b/app/(admin)/settings/admin-settings-client.tsx @@ -3,6 +3,7 @@ import { useState, useEffect } from "react"; import useSWR from "swr"; import { toast } from "sonner"; +import { formatBeijingTime } from "@/lib/utils"; import { Card, CardContent, @@ -1446,7 +1447,7 @@ export function AdminSettingsClient() { {img.userName || img.userEmail?.split("@")[0]}
- {new Date(img.createdAt).toLocaleDateString("zh-CN", { month: "numeric", day: "numeric" })} + {formatBeijingTime(img.createdAt, { month: "numeric", day: "numeric" })}
))} diff --git a/app/(chat)/featured/page.tsx b/app/(chat)/featured/page.tsx index a2b46aa..68e1fd1 100644 --- a/app/(chat)/featured/page.tsx +++ b/app/(chat)/featured/page.tsx @@ -7,6 +7,7 @@ import { Dialog, DialogContent } from "@/components/ui/dialog"; import { ArrowLeft, Download, ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight, Sparkles, User, Building2, Clock, Bot } from "lucide-react"; import { Input } from "@/components/ui/input"; import Image from "next/image"; +import { formatBeijingTime } from "@/lib/utils"; type FeaturedImage = { id: string; @@ -199,7 +200,7 @@ export default function FeaturedPage() { - {new Date(img.createdAt).toLocaleDateString("zh-CN", { + {formatBeijingTime(img.createdAt, { month: "short", day: "numeric", })} diff --git a/app/(chat)/gallery/page.tsx b/app/(chat)/gallery/page.tsx index 66b6e88..72b6323 100644 --- a/app/(chat)/gallery/page.tsx +++ b/app/(chat)/gallery/page.tsx @@ -8,6 +8,7 @@ import { ArrowLeft, Download, ChevronLeft, ChevronRight, ChevronsLeft, ChevronsR import { Input } from "@/components/ui/input"; import Image from "next/image"; import { toast } from "sonner"; +import { formatBeijingTime } from "@/lib/utils"; type GalleryImage = { id: string; @@ -341,7 +342,7 @@ export default function GalleryPage() {

{img.alt}

- {new Date(img.createdAt).toLocaleString("zh-CN", { + {formatBeijingTime(img.createdAt, { month: "short", day: "numeric", hour: "2-digit", @@ -494,7 +495,7 @@ export default function GalleryPage() {

{selectedImage.alt}

- {new Date(selectedImage.createdAt).toLocaleString("zh-CN")} + {formatBeijingTime(selectedImage.createdAt)}