补全翻译
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-11-16 12:44:52 +08:00
parent 30fc4ed64d
commit 7c5fc40209
31 changed files with 279 additions and 54 deletions

View File

@@ -1,5 +1,6 @@
import { redirect } from "next/navigation";
import { getServerSession } from "next-auth";
import { getTranslations } from "next-intl/server";
import InFolder from "./InFolder";
import { getOwnerByFolderId } from "@/lib/services/folderService";
export default async function FoldersPage({
@@ -10,12 +11,14 @@ export default async function FoldersPage({
const session = await getServerSession();
const { folder_id } = await params;
const id = Number(folder_id);
const t = await getTranslations("folders.folder_id");
if (!id) {
redirect("/folders");
}
if (!session?.user?.name) redirect(`/login?redirect=/folders/${id}`);
if ((await getOwnerByFolderId(id)) !== session.user.name) {
return "you are not the owner of this folder";
return <p>{t("unauthorized")}</p>;
}
return <InFolder folderId={id} />;
}