feat: 首次推送到Gitea - 完整项目代码 + 安全加固 + 知识库
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { requireAdmin } from "@/lib/admin-auth";
|
||||
import { badRequest, notFound, serverError } from "@/lib/api-error";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
|
||||
function generateSlug(name: string): string {
|
||||
return name
|
||||
@@ -79,8 +83,9 @@ export async function POST(
|
||||
toolId,
|
||||
message: "发布成功",
|
||||
});
|
||||
} catch (error: unknown) {
|
||||
const err = error as { message?: string };
|
||||
return NextResponse.json({ error: err.message }, { status: 500 });
|
||||
} catch (error) {
|
||||
return serverError(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user