- 新增许可证服务器 (license-server/) - 新增 Agent 部署模块 (flnxi-agent/) - 添加许可证验证和激活页面 - 添加 Harbor 镜像同步脚本 - 更新素材系统支持许可证验证
31 lines
786 B
TypeScript
31 lines
786 B
TypeScript
import { NextRequest, NextResponse } from 'next/server';
|
|
import { getAdminSession } from '@/lib/auth';
|
|
import { prisma } from '@/lib/db';
|
|
|
|
export async function POST(
|
|
request: NextRequest,
|
|
{ params }: { params: Promise<{ id: string }> }
|
|
) {
|
|
const session = await getAdminSession();
|
|
if (!session) {
|
|
return NextResponse.json({ error: '未授权' }, { status: 401 });
|
|
}
|
|
|
|
try {
|
|
const { id } = await params;
|
|
|
|
await prisma.alert.update({
|
|
where: { id },
|
|
data: {
|
|
status: 'resolved',
|
|
resolvedAt: new Date(),
|
|
},
|
|
});
|
|
|
|
return NextResponse.json({ success: true });
|
|
} catch (error) {
|
|
console.error('处理告警失败:', error);
|
|
return NextResponse.json({ success: false, error: '服务器错误' }, { status: 500 });
|
|
}
|
|
}
|