修改资源URL模式,不再存储https://domain 前缀

This commit is contained in:
2025-10-25 12:19:53 +08:00
parent f94ef73518
commit e4339a5b91
27 changed files with 347 additions and 137 deletions
+6 -5
View File
@@ -2,6 +2,7 @@ import { prisma } from "@/lib/prisma";
import FeedMasonry from "./components/FeedMasonry";
import type { FeedItem } from "./types/feed";
import type { Metadata } from "next";
import { getFileUrl } from "@/lib/minio";
export const metadata: Metadata = {
title: "作品集 - 抖歪",
@@ -28,11 +29,11 @@ export default async function Home() {
aweme_id: v.aweme_id,
created_at: v.created_at,
desc: v.desc,
video_url: v.video_url,
cover_url: v.cover_url ?? null,
video_url: getFileUrl(v.video_url),
cover_url: getFileUrl(v.cover_url ?? ''),
width: v.width ?? null,
height: v.height ?? null,
author: { nickname: v.author.nickname, avatar_url: v.author.avatar_url ?? null },
author: { nickname: v.author.nickname, avatar_url: getFileUrl(v.author.avatar_url ?? '') },
likes: Number(v.digg_count)
})),
...posts.map((p) => ({
@@ -40,10 +41,10 @@ export default async function Home() {
aweme_id: p.aweme_id,
created_at: p.created_at,
desc: p.desc,
cover_url: p.images?.[0]?.url ?? null,
cover_url: getFileUrl(p.images?.[0]?.url ?? null),
width: p.images?.[0]?.width ?? null,
height: p.images?.[0]?.height ?? null,
author: { nickname: p.author.nickname, avatar_url: p.author.avatar_url ?? null },
author: { nickname: p.author.nickname, avatar_url: getFileUrl(p.author.avatar_url ?? '') },
likes: Number(p.digg_count)
})),
]